pub struct AwsRestXmlProtocol { /* private fields */ }Expand description
AWS REST XML protocol (aws.protocols#restXml).
Implementations§
Source§impl AwsRestXmlProtocol
impl AwsRestXmlProtocol
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new AwsRestXmlProtocol with default settings:
Content-Type application/xml, date-time default timestamp
format, error envelopes wrapped in <ErrorResponse> (i.e.
noErrorWrapping = false), and no service-level @xmlNamespace.
Use Self::with_no_error_wrapping to opt in to the noErrorWrapping
variant of the @restXml trait, and
Self::with_service_xml_namespace to set a service-level default
xmlns. Both methods are typically called by code generation based on
the service shape’s traits; manual construction is fine for tests
or custom protocols.
Sourcepub fn with_no_error_wrapping(self, v: bool) -> Self
pub fn with_no_error_wrapping(self, v: bool) -> Self
Configure whether error responses use the noErrorWrapping variant
of the @restXml trait. When true, error response bodies have
<Error> as the document root; when false (default), they are
wrapped in <ErrorResponse><Error>...</Error>...</ErrorResponse>.
Drives the parsing branch in Self::deserialize_error_response.
Sourcepub fn no_error_wrapping(&self) -> bool
pub fn no_error_wrapping(&self) -> bool
Returns the current noErrorWrapping setting. See
Self::with_no_error_wrapping for semantics.
Sourcepub fn with_service_xml_namespace(
self,
uri: impl Into<String>,
prefix: Option<String>,
) -> Self
pub fn with_service_xml_namespace( self, uri: impl Into<String>, prefix: Option<String>, ) -> Self
Configures the service-level @xmlNamespace declared on the Smithy
service shape. Applied to request/response XML root elements that
don’t carry their own @xmlNamespace (e.g. S3’s
http://s3.amazonaws.com/doc/2006-03-01/).
Sourcepub fn deserialize_error_response<'a>(
&self,
body: &'a [u8],
) -> Result<(ErrorMetadataBuilder, Box<dyn ShapeDeserializer + 'a>), SerdeError>
pub fn deserialize_error_response<'a>( &self, body: &'a [u8], ) -> Result<(ErrorMetadataBuilder, Box<dyn ShapeDeserializer + 'a>), SerdeError>
Parses a REST XML error response envelope, extracting error metadata
(Code, Message, Type, RequestId) and returning a deserializer
positioned inside <Error> for per-error-shape member parsing.
Trait Implementations§
Source§impl ClientProtocolInner for AwsRestXmlProtocol
impl ClientProtocolInner for AwsRestXmlProtocol
Source§fn protocol_id(&self) -> &ShapeId
fn protocol_id(&self) -> &ShapeId
Source§fn serialize_request(
&self,
input: &dyn SerializableStruct,
input_schema: &Schema,
endpoint: &str,
cfg: &ConfigBag,
) -> Result<Request, SerdeError>
fn serialize_request( &self, input: &dyn SerializableStruct, input_schema: &Schema, endpoint: &str, cfg: &ConfigBag, ) -> Result<Request, SerdeError>
Source§fn deserialize_response<'a>(
&self,
response: &'a Response,
output_schema: &Schema,
cfg: &ConfigBag,
) -> Result<Box<dyn ShapeDeserializer + 'a>, SerdeError>
fn deserialize_response<'a>( &self, response: &'a Response, output_schema: &Schema, cfg: &ConfigBag, ) -> Result<Box<dyn ShapeDeserializer + 'a>, SerdeError>
ShapeDeserializer] over
the response body. Read moreSource§fn payload_codec(&self) -> Option<&dyn DynCodec>
fn payload_codec(&self) -> Option<&dyn DynCodec>
Source§impl Debug for AwsRestXmlProtocol
impl Debug for AwsRestXmlProtocol
Auto Trait Implementations§
impl Freeze for AwsRestXmlProtocol
impl RefUnwindSafe for AwsRestXmlProtocol
impl Send for AwsRestXmlProtocol
impl Sync for AwsRestXmlProtocol
impl Unpin for AwsRestXmlProtocol
impl UnsafeUnpin for AwsRestXmlProtocol
impl UnwindSafe for AwsRestXmlProtocol
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
§impl<P> ClientProtocol<<P as ClientProtocolInner>::Request, <P as ClientProtocolInner>::Response> for Pwhere
P: ClientProtocolInner,
impl<P> ClientProtocol<<P as ClientProtocolInner>::Request, <P as ClientProtocolInner>::Response> for Pwhere
P: ClientProtocolInner,
§fn protocol_id(&self) -> &ShapeId
fn protocol_id(&self) -> &ShapeId
§fn serialize_request(
&self,
input: &dyn SerializableStruct,
input_schema: &Schema,
endpoint: &str,
cfg: &ConfigBag,
) -> Result<<P as ClientProtocolInner>::Request, SerdeError>
fn serialize_request( &self, input: &dyn SerializableStruct, input_schema: &Schema, endpoint: &str, cfg: &ConfigBag, ) -> Result<<P as ClientProtocolInner>::Request, SerdeError>
§fn deserialize_response<'a>(
&self,
response: &'a <P as ClientProtocolInner>::Response,
output_schema: &Schema,
cfg: &ConfigBag,
) -> Result<Box<dyn ShapeDeserializer + 'a>, SerdeError>
fn deserialize_response<'a>( &self, response: &'a <P as ClientProtocolInner>::Response, output_schema: &Schema, cfg: &ConfigBag, ) -> Result<Box<dyn ShapeDeserializer + 'a>, SerdeError>
ShapeDeserializer].§fn update_endpoint(
&self,
request: &mut <P as ClientProtocolInner>::Request,
endpoint: &Endpoint,
cfg: &ConfigBag,
) -> Result<(), SerdeError>
fn update_endpoint( &self, request: &mut <P as ClientProtocolInner>::Request, endpoint: &Endpoint, cfg: &ConfigBag, ) -> Result<(), SerdeError>
§fn payload_codec(&self) -> Option<&dyn DynCodec>
fn payload_codec(&self) -> Option<&dyn DynCodec>
§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>
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