pub trait SerializeAttribute: Sized {
// Required method
fn serialize_attribute<S: AttributeSerializer>(
&self,
serializer: S,
) -> Result<S::Ok, S::Error>;
}Expand description
A type that can be serialized as an attribute. Since this is a separate trait from Serialize, it is possible to choose between serializing a type as an attribute or as an element.
To see the documentation for the derive macro, see [xmlity_derive::SerializeAttribute].
Required Methods§
Sourcefn serialize_attribute<S: AttributeSerializer>(
&self,
serializer: S,
) -> Result<S::Ok, S::Error>
fn serialize_attribute<S: AttributeSerializer>( &self, serializer: S, ) -> Result<S::Ok, S::Error>
Serialize the attribute.
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.