Trait AttributeSerializer

Source
pub trait AttributeSerializer: Sized {
    type Ok;
    type Error: Error;
    type SerializeAttribute<'a>: SerializeAttributeAccess<Ok = Self::Ok, Error = Self::Error>
       where Self: 'a;

    // Required methods
    fn serialize_attribute(
        &mut self,
        name: &ExpandedName<'_>,
    ) -> Result<Self::SerializeAttribute<'_>, Self::Error>;
    fn serialize_none(&mut self) -> Result<Self::Ok, Self::Error>;
}
Expand description

A type that can serialize attributes. Works in a similar way to Serializer.

Required Associated Types§

Source

type Ok

The type of the value that is returned when serialization is successful.

Source

type Error: Error

The type of the error that is returned when serialization fails.

Source

type SerializeAttribute<'a>: SerializeAttributeAccess<Ok = Self::Ok, Error = Self::Error> where Self: 'a

The type returned when serializing an attribute.

Required Methods§

Source

fn serialize_attribute( &mut self, name: &ExpandedName<'_>, ) -> Result<Self::SerializeAttribute<'_>, Self::Error>

Serialize an attribute.

Source

fn serialize_none(&mut self) -> Result<Self::Ok, Self::Error>

Serialize nothing.

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 AttributeSerializer for &mut &mut XmlElement

Source§

type Ok = ()

Source§

type Error = XmlValueSerializerError

Source§

type SerializeAttribute<'a> = XmlAttributeBuilder<'a> where Self: 'a