pub trait SerializeElement {
type Ok;
type Error: Error;
type ChildrenSerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>;
type SerializeElementAttributes: SerializeElementAttributes<Ok = Self::Ok, Error = Self::Error>;
// Required methods
fn include_prefix(
&mut self,
should_enforce: IncludePrefix,
) -> Result<Self::Ok, Self::Error>;
fn preferred_prefix(
&mut self,
preferred_prefix: Option<Prefix<'_>>,
) -> Result<Self::Ok, Self::Error>;
fn serialize_attributes(
self,
) -> Result<Self::SerializeElementAttributes, Self::Error>;
fn serialize_children(
self,
) -> Result<Self::ChildrenSerializeSeq, Self::Error>;
fn end(self) -> Result<Self::Ok, Self::Error>;
}
Expand description
A trait for serializing elements.
Required Associated Types§
Sourcetype ChildrenSerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>
type ChildrenSerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>
The type of the serializer that is returned when serializing the children of this element.
Sourcetype SerializeElementAttributes: SerializeElementAttributes<Ok = Self::Ok, Error = Self::Error>
type SerializeElementAttributes: SerializeElementAttributes<Ok = Self::Ok, Error = Self::Error>
The type of the serializer that is returned when serializing the attributes of this element.
Required Methods§
Sourcefn include_prefix(
&mut self,
should_enforce: IncludePrefix,
) -> Result<Self::Ok, Self::Error>
fn include_prefix( &mut self, should_enforce: IncludePrefix, ) -> Result<Self::Ok, Self::Error>
Always serialize this element with the given prefix.
Sourcefn preferred_prefix(
&mut self,
preferred_prefix: Option<Prefix<'_>>,
) -> Result<Self::Ok, Self::Error>
fn preferred_prefix( &mut self, preferred_prefix: Option<Prefix<'_>>, ) -> Result<Self::Ok, Self::Error>
Set the preferred prefix for this element.
Sourcefn serialize_attributes(
self,
) -> Result<Self::SerializeElementAttributes, Self::Error>
fn serialize_attributes( self, ) -> Result<Self::SerializeElementAttributes, Self::Error>
Serialize the attributes of this element.
Sourcefn serialize_children(self) -> Result<Self::ChildrenSerializeSeq, Self::Error>
fn serialize_children(self) -> Result<Self::ChildrenSerializeSeq, Self::Error>
Serialize the children of this element.