Skip to main content

with_deserializer_from_slice

Function with_deserializer_from_slice 

Source
pub fn with_deserializer_from_slice<'de, R, F>(
    bytes: &'de [u8],
    f: F,
) -> Result<R, Error>
where for<'e> F: FnOnce(Deserializer<'de, 'e>) -> Result<R, Error>,
Expand description

Create a streaming crate::Deserializer for a UTF-8 byte slice and run a closure against it.

This is equivalent to with_deserializer_from_str, but validates the input is UTF-8.