Skip to main content

XmlSerializer

Struct XmlSerializer 

Source
pub struct XmlSerializer { /* private fields */ }
Expand description

XML serializer that implements the [ShapeSerializer] trait.

Implementations§

Source§

impl XmlSerializer

Source

pub fn set_next_root_xml_name(&mut self, name: String)

Sets a one-shot override for the wrapper element name on the next document-root write_struct. Consumed on first use. Intended for protocol-layer use (e.g. REST XML routing of @httpPayload struct members whose member-level @xmlName would otherwise be invisible to the codec — codegen passes the target shape’s SCHEMA, which carries the target’s @xmlName but not the member’s).

Source

pub fn set_next_root_xml_namespace( &mut self, uri: String, prefix: Option<String>, )

Sets a one-shot fallback xmlns for the document-root element. Consumed on the first root-level write_struct only when the struct’s own schema has no xml_namespace (per the Smithy spec, a shape-level @xmlNamespace overrides any service-level default). Intended for the REST XML protocol to apply the service-level @xmlNamespace to operation request/response root elements.

Trait Implementations§

Source§

impl FinishSerializer for XmlSerializer

Source§

fn finish(self) -> Vec<u8>

Consumes the serializer and returns the serialized bytes.
Source§

impl ShapeSerializer for XmlSerializer

Source§

fn write_struct( &mut self, schema: &Schema, value: &dyn SerializableStruct, ) -> Result<(), SerdeError>

Writes a structure to the serializer. Read more
Source§

fn write_list( &mut self, schema: &Schema, write_elements: &dyn Fn(&mut dyn ShapeSerializer) -> Result<(), SerdeError>, ) -> Result<(), SerdeError>

Writes a list to the serializer. Read more
Source§

fn write_map( &mut self, schema: &Schema, write_entries: &dyn Fn(&mut dyn ShapeSerializer) -> Result<(), SerdeError>, ) -> Result<(), SerdeError>

Writes a map to the serializer. Read more
Source§

fn write_boolean( &mut self, schema: &Schema, value: bool, ) -> Result<(), SerdeError>

Writes a boolean value.
Source§

fn write_byte(&mut self, schema: &Schema, value: i8) -> Result<(), SerdeError>

Writes a byte (i8) value.
Source§

fn write_short(&mut self, schema: &Schema, value: i16) -> Result<(), SerdeError>

Writes a short (i16) value.
Source§

fn write_integer( &mut self, schema: &Schema, value: i32, ) -> Result<(), SerdeError>

Writes an integer (i32) value.
Source§

fn write_long(&mut self, schema: &Schema, value: i64) -> Result<(), SerdeError>

Writes a long (i64) value.
Source§

fn write_float(&mut self, schema: &Schema, value: f32) -> Result<(), SerdeError>

Writes a float (f32) value.
Source§

fn write_double( &mut self, schema: &Schema, value: f64, ) -> Result<(), SerdeError>

Writes a double (f64) value.
Source§

fn write_big_integer( &mut self, schema: &Schema, value: &BigInteger, ) -> Result<(), SerdeError>

Writes a big integer value.
Source§

fn write_big_decimal( &mut self, schema: &Schema, value: &BigDecimal, ) -> Result<(), SerdeError>

Writes a big decimal value.
Source§

fn write_string( &mut self, schema: &Schema, value: &str, ) -> Result<(), SerdeError>

Writes a string value.
Source§

fn write_blob( &mut self, schema: &Schema, value: &[u8], ) -> Result<(), SerdeError>

Writes a blob (byte array) value. Read more
Source§

fn write_timestamp( &mut self, schema: &Schema, value: &DateTime, ) -> Result<(), SerdeError>

Writes a timestamp value.
Source§

fn write_document( &mut self, _schema: &Schema, _value: &Document, ) -> Result<(), SerdeError>

Writes a document value.
Source§

fn write_null(&mut self, _schema: &Schema) -> Result<(), SerdeError>

Writes a null value (for sparse collections).
§

fn write_string_list( &mut self, schema: &Schema, values: &[String], ) -> Result<(), SerdeError>

Writes a list of strings.
§

fn write_blob_list( &mut self, schema: &Schema, values: &[Blob], ) -> Result<(), SerdeError>

Writes a list of blobs.
§

fn write_integer_list( &mut self, schema: &Schema, values: &[i32], ) -> Result<(), SerdeError>

Writes a list of integers.
§

fn write_long_list( &mut self, schema: &Schema, values: &[i64], ) -> Result<(), SerdeError>

Writes a list of longs.
§

fn write_string_string_map( &mut self, schema: &Schema, values: &HashMap<String, String>, ) -> Result<(), SerdeError>

Writes a map with string keys and string values.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
§

impl<S> PayloadSerializer for S
where S: ShapeSerializer + FinishSerializer,

§

fn finish_boxed(self: Box<S>) -> Vec<u8>

Consumes this boxed serializer and returns the serialized bytes.
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more