pub struct RestXml { /* private fields */ }Expand description
Stateful schema-driven restXml protocol implementation.
Wrapped collections read only their modeled item and entry names. Requests accept
application/xml, and parsing checks the modeled root while retaining the generated serde
parser’s recovery from malformed XML.
Trait Implementations§
Source§impl MetadataRoutedProtocol for RestXml
impl MetadataRoutedProtocol for RestXml
Source§fn from_build_context(
ctx: &ProtocolBuildContext<'_>,
) -> Result<Self, RouterBuildError>
fn from_build_context( ctx: &ProtocolBuildContext<'_>, ) -> Result<Self, RouterBuildError>
Builds this protocol for a service, from its registered configuration. Invalid
configuration fails the service build.
Source§fn build_router(
&self,
ctx: RouterBuildContext<'_>,
) -> Result<impl MetadataProtocolRouter + 'static + use<>, RouterBuildError>
fn build_router( &self, ctx: RouterBuildContext<'_>, ) -> Result<impl MetadataProtocolRouter + 'static + use<>, RouterBuildError>
Builds operation routing once for this service. Read more
Source§fn event_stream_framing(&self) -> Option<EventStreamFraming<'_>>
fn event_stream_framing(&self) -> Option<EventStreamFraming<'_>>
Event-frame support, when this protocol supports event streams.
Source§impl ServerProtocol for RestXml
impl ServerProtocol for RestXml
Source§fn serialize_rejection(&self, err: DeserializeError) -> Response
fn serialize_rejection(&self, err: DeserializeError) -> Response
restXml keeps 415 for Content-Type failures, but its From<RequestRejection> has no
NotAcceptable arm, so an Accept mismatch falls through to a 400 Serialization, NOT
a 406. And its RuntimeError response drops the validation body entirely: every runtime
error, constraint violations included, answers with the literal {} body, so a constraint
violation must NOT serialize the modeled error here. Both are the protocol’s wire contract.
Source§fn protocol_id(&self) -> &'static ShapeId<'static>
fn protocol_id(&self) -> &'static ShapeId<'static>
The protocol trait’s shape ID, such as
aws.protocols#restJson1.Source§fn validate_request_headers(
&self,
operation: &OperationSchema<'_>,
headers: &Headers,
) -> Result<(), DeserializeError>
fn validate_request_headers( &self, operation: &OperationSchema<'_>, headers: &Headers, ) -> Result<(), DeserializeError>
Validates request headers for the selected operation before upgrade body collection
and
Self::deserialize_request. Header failures therefore take precedence over
deserialization failures. The built-in protocols check Accept against the response
content type. The default accepts all headers.Source§fn request_body_requirement(
&self,
operation: &OperationSchema<'_>,
) -> BodyDirective
fn request_body_requirement( &self, operation: &OperationSchema<'_>, ) -> BodyDirective
Specifies whether deserialization needs the request body. The default collects it. Read more
Source§fn deserialize_request<'a>(
&'a self,
input: &Schema<'_>,
request: &'a Request<Bytes>,
) -> Result<Box<dyn ShapeDeserializer + 'a>, DeserializeError>
fn deserialize_request<'a>( &'a self, input: &Schema<'_>, request: &'a Request<Bytes>, ) -> Result<Box<dyn ShapeDeserializer + 'a>, DeserializeError>
Source§fn serialize_response(
&self,
output: &Schema<'_>,
value: &dyn SerializableStruct,
) -> Response
fn serialize_response( &self, output: &Schema<'_>, value: &dyn SerializableStruct, ) -> Response
Source§fn serialize_streaming_response(
&self,
output: &Schema<'_>,
value: &dyn SerializableStruct,
_streaming_member: &Schema<'_>,
body: Option<BoxBody>,
) -> Response
fn serialize_streaming_response( &self, output: &Schema<'_>, value: &dyn SerializableStruct, _streaming_member: &Schema<'_>, body: Option<BoxBody>, ) -> Response
Source§fn serialize_error(&self, error: &dyn HttpModeledError) -> Response
fn serialize_error(&self, error: &dyn HttpModeledError) -> Response
Serializes a modeled error with the protocol’s discriminator framing.
Source§fn serialize_routing_error(&self, err: &RoutingError) -> Response
fn serialize_routing_error(&self, err: &RoutingError) -> Response
Converts a routing rejection into this protocol’s response. Read more
Source§fn serialize_runtime_error(&self, error: RuntimeError) -> Response
fn serialize_runtime_error(&self, error: RuntimeError) -> Response
Frames a shared extractor runtime error using this protocol’s runtime-error contract. Read more
Auto Trait Implementations§
impl Freeze for RestXml
impl !RefUnwindSafe for RestXml
impl Send for RestXml
impl Sync for RestXml
impl Unpin for RestXml
impl UnsafeUnpin for RestXml
impl !UnwindSafe for RestXml
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<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.