Function pot::to_vec

source · []
pub fn to_vec<T>(value: &T) -> Result<Vec<u8>> where
    T: Serialize
Expand description

Serialize value using Pot into a Vec<u8>.

let serialized = pot::to_vec(&"hello world").unwrap();
let deserialized = pot::from_slice::<String>(&serialized).unwrap();
assert_eq!(deserialized, "hello world");