Function crdts::to_binary
[−]
[src]
pub fn to_binary<A: Serialize>(s: &A) -> Vec<u8>
Dumps this type to 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);