Function crdts::from_binary [] [src]

pub fn from_binary<A: Decodable>(encoded: Vec<u8>) -> DecodingResult<A>

Attempts to reconstruct a type from binary.

Examples

use crdts::{Orswot, to_binary, from_binary};
let mut a = Orswot::new();
a.add(1, 1);
let encoded = to_binary(&a);
let decoded = from_binary(encoded).unwrap();
assert_eq!(a, decoded);