xsd_parser::quick_xml

Trait DeserializeBytes

Source
pub trait DeserializeBytes: Sized {
    // Required method
    fn deserialize_bytes<R: XmlReader>(
        reader: &R,
        bytes: &[u8],
    ) -> Result<Self, Error>;
}
Expand description

Trait that could be implemented by types to support deserialization from XML byte streams using the quick_xml crate.

This is usually implemented for simple types like numbers, strings or enums.

Required Methods§

Source

fn deserialize_bytes<R: XmlReader>( reader: &R, bytes: &[u8], ) -> Result<Self, Error>

Try to deserialize the type from bytes.

This is used to deserialize the type from attributes or raw element content.

§Errors

Returns a suitable Error if the deserialization was not successful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§