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§
Sourcetype SerializeAttribute<'a>: SerializeAttributeAccess<Ok = Self::Ok, Error = Self::Error>
where
Self: 'a
type SerializeAttribute<'a>: SerializeAttributeAccess<Ok = Self::Ok, Error = Self::Error> where Self: 'a
The type returned when serializing an attribute.
Required Methods§
Sourcefn serialize_attribute(
&mut self,
name: &ExpandedName<'_>,
) -> Result<Self::SerializeAttribute<'_>, Self::Error>
fn serialize_attribute( &mut self, name: &ExpandedName<'_>, ) -> Result<Self::SerializeAttribute<'_>, Self::Error>
Serialize an attribute.
Sourcefn serialize_none(&mut self) -> Result<Self::Ok, Self::Error>
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.