xsd_parser::quick_xml

Trait Serializer

Source
pub trait Serializer<'ser, T>:
    Iterator<Item = Result<Event<'ser>, Error>>
    + Debug
    + Sized {
    // Required method
    fn init(
        value: &'ser T,
        name: Option<&'ser str>,
        is_root: bool,
    ) -> Result<Self, Error>;
}
Expand description

Trait that defines a serializer that can be used to destruct a type to suitable XML Events.

Required Methods§

Source

fn init( value: &'ser T, name: Option<&'ser str>, is_root: bool, ) -> Result<Self, Error>

Initializes a new serializer from the passed value.

§Errors

Returns a suitable Error is the serializer could not be initialized.

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§

Source§

impl<'ser, T> Serializer<'ser, T> for ContentSerializer<'ser, T>
where T: SerializeBytes + Debug,

Source§

impl<'ser, T, TItem> Serializer<'ser, T> for IterSerializer<'ser, T, TItem>
where T: Debug + 'ser, &'ser T: IntoIterator<Item = &'ser TItem>, <&'ser T as IntoIterator>::IntoIter: Debug, TItem: WithSerializer + Debug + 'ser,