Skip to main content

deserialize_optional_bytes

Function deserialize_optional_bytes 

pub fn deserialize_optional_bytes<'de, D>(
    deserializer: D,
) -> Result<Option<Vec<u8>>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,
Expand description

A nullable Bytes field, or a patch-wrapped required one — Option<Vec<u8>>. Pair with #[serde(default, …)]: a custom deserialize_with opts the field out of serde-derive’s implicit “missing Option<T> field defaults to None” (see crate::patch).