pub struct Serializer<W: Write> { /* private fields */ }Expand description
The xmlity::Deserializer for the quick-xml crate.
Implementations§
Source§impl<W: Write> Serializer<W>
impl<W: Write> Serializer<W>
Sourcepub fn new(writer: QuickXmlWriter<W>) -> Self
pub fn new(writer: QuickXmlWriter<W>) -> Self
Create a new serializer.
Sourcepub fn new_with_namespaces(
writer: QuickXmlWriter<W>,
preferred_namespace_prefixes: BTreeMap<XmlNamespace<'static>, Prefix<'static>>,
) -> Self
pub fn new_with_namespaces( writer: QuickXmlWriter<W>, preferred_namespace_prefixes: BTreeMap<XmlNamespace<'static>, Prefix<'static>>, ) -> Self
Create a new serializer with preferred namespace prefixes.
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Consume the serializer and return the underlying writer.
Trait Implementations§
Source§impl<W: Write> From<W> for Serializer<W>
impl<W: Write> From<W> for Serializer<W>
Source§impl<W: Write> From<Writer<W>> for Serializer<W>
impl<W: Write> From<Writer<W>> for Serializer<W>
Source§fn from(writer: QuickXmlWriter<W>) -> Self
fn from(writer: QuickXmlWriter<W>) -> Self
Converts to this type from the input type.
Source§impl<'s, W: Write> Serializer for &'s mut Serializer<W>
impl<'s, W: Write> Serializer for &'s mut Serializer<W>
Source§type SerializeElement = SerializeElement<'s, W>
type SerializeElement = SerializeElement<'s, W>
The type of the serializer that is used to serialize an element with children.
Source§type SerializeSeq = SerializeSeq<'s, W>
type SerializeSeq = SerializeSeq<'s, W>
The type of the serializer that is used to serialize a sequence of elements.
Source§fn serialize_cdata<S: AsRef<str>>(
self,
text: S,
) -> Result<Self::Ok, Self::Error>
fn serialize_cdata<S: AsRef<str>>( self, text: S, ) -> Result<Self::Ok, Self::Error>
Serialize a CDATA section.
Source§fn serialize_text<S: AsRef<str>>(self, text: S) -> Result<Self::Ok, Self::Error>
fn serialize_text<S: AsRef<str>>(self, text: S) -> Result<Self::Ok, Self::Error>
Serialize a text node.
Source§fn serialize_element<'a>(
self,
name: &'a ExpandedName<'a>,
) -> Result<Self::SerializeElement, Self::Error>
fn serialize_element<'a>( self, name: &'a ExpandedName<'a>, ) -> Result<Self::SerializeElement, Self::Error>
Serialize an element with children.
Source§fn serialize_seq(self) -> Result<Self::SerializeSeq, Self::Error>
fn serialize_seq(self) -> Result<Self::SerializeSeq, Self::Error>
Serialize a sequence of elements.
Source§fn serialize_decl<S: AsRef<str>>(
self,
version: S,
encoding: Option<S>,
standalone: Option<S>,
) -> Result<Self::Ok, Self::Error>
fn serialize_decl<S: AsRef<str>>( self, version: S, encoding: Option<S>, standalone: Option<S>, ) -> Result<Self::Ok, Self::Error>
Serialize an XML declaration.
Source§fn serialize_pi<S: AsRef<[u8]>>(
self,
target: S,
content: S,
) -> Result<Self::Ok, Self::Error>
fn serialize_pi<S: AsRef<[u8]>>( self, target: S, content: S, ) -> Result<Self::Ok, Self::Error>
Serialize a processing instruction.
Source§fn serialize_comment<S: AsRef<[u8]>>(
self,
text: S,
) -> Result<Self::Ok, Self::Error>
fn serialize_comment<S: AsRef<[u8]>>( self, text: S, ) -> Result<Self::Ok, Self::Error>
Serialize a comment.