pub fn deserialize_vec<T: TryFrom<String>>(
buffer: &mut Vec<u8>,
) -> Result<Vec<T>, DeserializationError>Expand description
Removes the next collection of strings from the buffer. If an error occurs for an element after the first, the buffer is left in an indeterminate state.
ยงExamples
let mut buffer = [2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 72, 101, 108, 108, 111, 5, 0, 0, 0, 0, 0, 0, 0, 87, 111, 114, 108, 100].to_vec();
let value = blt_utils::deserialize_vec::<String>(&mut buffer)?;
assert_eq!(value.as_slice(), [String::from("Hello"), String::from("World")]);