Serializer

Struct Serializer 

Source
pub struct Serializer<W: Write> { /* private fields */ }
Expand description

The xmlity::Deserializer for the quick-xml crate.

Implementations§

Source§

impl<W: Write> Serializer<W>

Source

pub fn new(writer: QuickXmlWriter<W>) -> Self

Create a new serializer.

Source

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.

Source

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>

Source§

fn from(writer: W) -> Self

Converts to this type from the input type.
Source§

impl<W: Write> From<Writer<W>> for Serializer<W>

Source§

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>

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 SerializeElement = SerializeElement<'s, W>

The type of the serializer that is used to serialize an element with children.
Source§

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>

Serialize a CDATA section.
Source§

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>

Serialize an element with children.
Source§

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>

Serialize an XML declaration.
Source§

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>

Serialize a comment.
Source§

fn serialize_doctype<S: AsRef<[u8]>>( self, text: S, ) -> Result<Self::Ok, Self::Error>

Serialize a doctype declaration.
Source§

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

Serialize nothing.

Auto Trait Implementations§

§

impl<W> Freeze for Serializer<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for Serializer<W>
where W: RefUnwindSafe,

§

impl<W> Send for Serializer<W>
where W: Send,

§

impl<W> Sync for Serializer<W>
where W: Sync,

§

impl<W> Unpin for Serializer<W>
where W: Unpin,

§

impl<W> UnwindSafe for Serializer<W>
where W: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.