pub struct XmlCodec { /* private fields */ }Expand description
XML codec for schema-based serialization and deserialization.
Used by REST XML to serialize request bodies and deserialize response
bodies. The codec carries no state of its own — each create_serializer
and create_deserializer call returns a fresh instance whose lifetime
brackets one (de)serialization.
§Examples
use aws_smithy_xml::codec::{XmlCodec, XmlCodecSettings};
use aws_smithy_schema::codec::Codec;
let codec = XmlCodec::new(XmlCodecSettings::default());
let _serializer = codec.create_serializer();
let _deserializer = codec.create_deserializer(b"<Root/>");Implementations§
Source§impl XmlCodec
impl XmlCodec
Sourcepub fn new(settings: XmlCodecSettings) -> Self
pub fn new(settings: XmlCodecSettings) -> Self
Creates a new XML codec with the given settings.
Creates a new XML codec from a pre-existing shared settings.
Sourcepub fn settings(&self) -> &XmlCodecSettings
pub fn settings(&self) -> &XmlCodecSettings
Returns the codec settings.
Trait Implementations§
Source§impl Codec for XmlCodec
impl Codec for XmlCodec
Source§type Serializer = XmlSerializer
type Serializer = XmlSerializer
The serializer type for this codec.
Source§type Deserializer<'a> = XmlDeserializer<'a>
type Deserializer<'a> = XmlDeserializer<'a>
The deserializer type for this codec.
Source§fn create_serializer(&self) -> Self::Serializer
fn create_serializer(&self) -> Self::Serializer
Creates a new serializer for this codec.
Source§fn create_deserializer<'a>(&self, input: &'a [u8]) -> Self::Deserializer<'a>
fn create_deserializer<'a>(&self, input: &'a [u8]) -> Self::Deserializer<'a>
Creates a new deserializer for this codec from the given input bytes.
Auto Trait Implementations§
impl Freeze for XmlCodec
impl RefUnwindSafe for XmlCodec
impl Send for XmlCodec
impl Sync for XmlCodec
impl Unpin for XmlCodec
impl UnsafeUnpin for XmlCodec
impl UnwindSafe for XmlCodec
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
Mutably borrows from an owned value. Read more
§impl<C> DynCodec for C
impl<C> DynCodec for C
§fn create_deserializer<'a>(
&self,
input: &'a [u8],
) -> Box<dyn ShapeDeserializer + 'a>
fn create_deserializer<'a>( &self, input: &'a [u8], ) -> Box<dyn ShapeDeserializer + 'a>
Creates a new deserializer over the given input bytes.
§fn create_serializer(&self) -> Box<dyn PayloadSerializer + '_>
fn create_serializer(&self) -> Box<dyn PayloadSerializer + '_>
Creates a new serializer. Use [
PayloadSerializer::finish_boxed] to
consume the serializer and obtain the serialized bytes.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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 moreCreates a shared type from an unshared type.