SerializeBytes

Trait SerializeBytes 

Source
pub trait SerializeBytes: Sized {
    // Required method
    fn serialize_bytes(&self) -> Result<Option<Cow<'_, str>>, Error>;
}
Expand description

Trait that could be implemented by types to support serialization to XML byte streams.

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

Required Methods§

Source

fn serialize_bytes(&self) -> Result<Option<Cow<'_, str>>, Error>

Try to serialize the type to bytes.

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

§Errors

Returns a suitable Error if the serialization 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§