polars_utils::pl_serialize

Function deserialize_map_bytes

Source
pub fn deserialize_map_bytes<'de, D, O>(
    deserializer: D,
    func: &mut dyn for<'b> FnMut(Cow<'b, [u8]>) -> O,
) -> Result<O, D::Error>
where D: Deserializer<'de>,
Available on crate feature serde only.
Expand description

Potentially avoids copying memory compared to a naive Vec::<u8>::deserialize.

This is essentially boilerplate for visiting bytes without copying where possible.