pub fn encode_one<T: CandidType>(argument: T) -> Result<Vec<u8>>
Expand description
Serialize a single value to a vector of bytes.
let golden = "hello";
let buffer = encode_one(golden).unwrap();
let (value) = Decode!(&buffer, String).unwrap();
assert_eq!(golden, value);