[][src]Function serde_lexpr::to_vec

pub fn to_vec<T>(value: &T) -> Result<Vec<u8>> where
    T: Serialize

Serialize an instance of type T into an S-expression byte vector, using the default printer options.

use serde_lexpr::to_vec;

let expected: Vec<u8> = r#"#("foo" 1)"#.into();
assert_eq!(to_vec(&("foo", 1)).unwrap(), expected);