pub struct Deserializer<'de, R>where
    R: XmlRead<'de>,
{ /* private fields */ }
Expand description

An xml deserializer

Implementations

Create an XML deserializer from one of the possible quick_xml input sources.

Typically it is more convenient to use one of these methods instead:

👎Deprecated:

Use Deserializer::new instead

Get a new deserializer from a regular BufRead

Create new deserializer that will borrow data from the specified string

Create new deserializer that will borrow data from the specified byte array

Create new deserializer that will copy data from the specified reader into internal buffer. If you already have a string or a byte array, use Self::from_str or Self::from_slice instead, because they will borrow instead of copy, whenever possible

Trait Implementations

Representation of owned strings the same as non-owned.

Unit represented in XML as a xs:element or text/CDATA content. Any content inside xs:element is ignored and skipped.

Produces unit struct from any of following inputs:

  • any <tag ...>...</tag>
  • any <tag .../>
  • any text content
  • any CDATA content
Events handling
EventXMLHandling
DeEvent::Start<tag>...</tag>Calls visitor.visit_unit(), consumes all events up to corresponding End event
DeEvent::End</tag>Emits DeError::End
DeEvent::Texttext contentCalls visitor.visit_unit(). Text content is ignored
DeEvent::CData<![CDATA[cdata content]]>Calls visitor.visit_unit(). CDATA content is ignored
DeEvent::EofEmits DeError::Eof

Representation of the names units the same as unnamed units

Representation of tuples the same as sequences.

Representation of named tuples the same as unnamed tuples.

Always call visitor.visit_unit() because returned value ignored in any case.

This method consumes any single event except the Start event, in which case all events up to corresponding End event will be consumed.

This method returns error if current event is End or Eof

The error type that can be returned if some error occurs during deserialization. Read more

Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more

Hint that the Deserialize type is expecting a bool value.

Hint that the Deserialize type is expecting a char value.

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a newtype struct with a particular name. Read more

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more

Hint that the Deserialize type is expecting a sequence of values.

Hint that the Deserialize type is expecting a map of key-value pairs.

Hint that the Deserialize type is expecting an optional value. Read more

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. Read more

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more

Hint that the Deserialize type is expecting an i8 value.

Hint that the Deserialize type is expecting an i16 value.

Hint that the Deserialize type is expecting an i32 value.

Hint that the Deserialize type is expecting an i64 value.

Hint that the Deserialize type is expecting a u8 value.

Hint that the Deserialize type is expecting a u16 value.

Hint that the Deserialize type is expecting a u32 value.

Hint that the Deserialize type is expecting a u64 value.

Hint that the Deserialize type is expecting a f32 value.

Hint that the Deserialize type is expecting a f64 value.

Hint that the Deserialize type is expecting an i128 value. Read more

Hint that the Deserialize type is expecting an u128 value. Read more

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.