pub struct XmlDeserializer<'a> { /* private fields */ }Expand description
XML deserializer that implements the ShapeDeserializer trait.
Wraps the existing aws_smithy_xml::decode SAX-like API and provides
schema-driven dispatch for struct members, lists, and maps.
The deserializer holds the input as &'a [u8] throughout. For aggregate
reads (read_struct, read_list, read_map) we construct a fresh
Document over input on demand. For scalar reads we either parse
input to extract the root element’s text, or — when a parent
aggregate has already extracted the leaf text from its child element —
take the pre-extracted text directly via text.
Sibling dispatch within an aggregate read avoids per-iteration
XmlDeserializer construction by reusing &mut self through
dispatch_subslice / dispatch_text helpers, which save and restore
the relevant state across the closure call.
Trait Implementations§
Source§impl ShapeDeserializer for XmlDeserializer<'_>
impl ShapeDeserializer for XmlDeserializer<'_>
Source§fn skip_value(&mut self) -> Result<(), SerdeError>
fn skip_value(&mut self) -> Result<(), SerdeError>
Nothing to advance. read_struct delimits each child before dispatching it —
either as an owned sub-slice or as pre-extracted text — and the child’s
ScopedDecoder is dropped, which moves the parent’s tokenizer past the closing
tag regardless of what the consumer did. Advancing again here would consume a
sibling element.
Source§fn read_struct(
&mut self,
schema: &Schema<'_>,
consumer: &mut dyn FnMut(&Schema<'_>, &mut dyn ShapeDeserializer) -> Result<(), SerdeError>,
) -> Result<(), SerdeError>
fn read_struct( &mut self, schema: &Schema<'_>, consumer: &mut dyn FnMut(&Schema<'_>, &mut dyn ShapeDeserializer) -> Result<(), SerdeError>, ) -> Result<(), SerdeError>
Source§fn read_list(
&mut self,
_schema: &Schema<'_>,
consumer: &mut dyn FnMut(&mut dyn ShapeDeserializer) -> Result<(), SerdeError>,
) -> Result<(), SerdeError>
fn read_list( &mut self, _schema: &Schema<'_>, consumer: &mut dyn FnMut(&mut dyn ShapeDeserializer) -> Result<(), SerdeError>, ) -> Result<(), SerdeError>
Source§fn read_map(
&mut self,
schema: &Schema<'_>,
consumer: &mut dyn FnMut(String, &mut dyn ShapeDeserializer) -> Result<(), SerdeError>,
) -> Result<(), SerdeError>
fn read_map( &mut self, schema: &Schema<'_>, consumer: &mut dyn FnMut(String, &mut dyn ShapeDeserializer) -> Result<(), SerdeError>, ) -> Result<(), SerdeError>
Source§fn read_boolean(&mut self, _schema: &Schema<'_>) -> Result<bool, SerdeError>
fn read_boolean(&mut self, _schema: &Schema<'_>) -> Result<bool, SerdeError>
Source§fn read_byte(&mut self, _schema: &Schema<'_>) -> Result<i8, SerdeError>
fn read_byte(&mut self, _schema: &Schema<'_>) -> Result<i8, SerdeError>
Source§fn read_short(&mut self, _schema: &Schema<'_>) -> Result<i16, SerdeError>
fn read_short(&mut self, _schema: &Schema<'_>) -> Result<i16, SerdeError>
Source§fn read_integer(&mut self, _schema: &Schema<'_>) -> Result<i32, SerdeError>
fn read_integer(&mut self, _schema: &Schema<'_>) -> Result<i32, SerdeError>
Source§fn read_long(&mut self, _schema: &Schema<'_>) -> Result<i64, SerdeError>
fn read_long(&mut self, _schema: &Schema<'_>) -> Result<i64, SerdeError>
Source§fn read_float(&mut self, _schema: &Schema<'_>) -> Result<f32, SerdeError>
fn read_float(&mut self, _schema: &Schema<'_>) -> Result<f32, SerdeError>
Source§fn read_double(&mut self, _schema: &Schema<'_>) -> Result<f64, SerdeError>
fn read_double(&mut self, _schema: &Schema<'_>) -> Result<f64, SerdeError>
Source§fn read_big_integer(
&mut self,
_schema: &Schema<'_>,
) -> Result<BigInteger, SerdeError>
fn read_big_integer( &mut self, _schema: &Schema<'_>, ) -> Result<BigInteger, SerdeError>
Source§fn read_big_decimal(
&mut self,
_schema: &Schema<'_>,
) -> Result<BigDecimal, SerdeError>
fn read_big_decimal( &mut self, _schema: &Schema<'_>, ) -> Result<BigDecimal, SerdeError>
Source§fn read_string(&mut self, _schema: &Schema<'_>) -> Result<String, SerdeError>
fn read_string(&mut self, _schema: &Schema<'_>) -> Result<String, SerdeError>
Source§fn read_blob(&mut self, _schema: &Schema<'_>) -> Result<Blob, SerdeError>
fn read_blob(&mut self, _schema: &Schema<'_>) -> Result<Blob, SerdeError>
Source§fn read_timestamp(
&mut self,
schema: &Schema<'_>,
) -> Result<DateTime, SerdeError>
fn read_timestamp( &mut self, schema: &Schema<'_>, ) -> Result<DateTime, SerdeError>
Source§fn read_document(
&mut self,
_schema: &Schema<'_>,
) -> Result<SmithyDocument, SerdeError>
fn read_document( &mut self, _schema: &Schema<'_>, ) -> Result<SmithyDocument, SerdeError>
Source§fn read_string_list(
&mut self,
_schema: &Schema<'_>,
) -> Result<Vec<String>, SerdeError>
fn read_string_list( &mut self, _schema: &Schema<'_>, ) -> Result<Vec<String>, SerdeError>
Source§fn read_blob_list(
&mut self,
_schema: &Schema<'_>,
) -> Result<Vec<Blob>, SerdeError>
fn read_blob_list( &mut self, _schema: &Schema<'_>, ) -> Result<Vec<Blob>, SerdeError>
Source§fn read_integer_list(
&mut self,
_schema: &Schema<'_>,
) -> Result<Vec<i32>, SerdeError>
fn read_integer_list( &mut self, _schema: &Schema<'_>, ) -> Result<Vec<i32>, SerdeError>
Source§fn read_long_list(
&mut self,
_schema: &Schema<'_>,
) -> Result<Vec<i64>, SerdeError>
fn read_long_list( &mut self, _schema: &Schema<'_>, ) -> Result<Vec<i64>, SerdeError>
Source§fn read_string_string_map(
&mut self,
schema: &Schema<'_>,
) -> Result<HashMap<String, String>, SerdeError>
fn read_string_string_map( &mut self, schema: &Schema<'_>, ) -> Result<HashMap<String, String>, SerdeError>
Auto Trait Implementations§
impl<'a> Freeze for XmlDeserializer<'a>
impl<'a> RefUnwindSafe for XmlDeserializer<'a>
impl<'a> Send for XmlDeserializer<'a>
impl<'a> Sync for XmlDeserializer<'a>
impl<'a> Unpin for XmlDeserializer<'a>
impl<'a> UnsafeUnpin for XmlDeserializer<'a>
impl<'a> UnwindSafe for XmlDeserializer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more