Skip to main content

RestXml

Struct RestXml 

Source
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 Debug for RestXml

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RestXml

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl MetadataRoutedProtocol for RestXml

Source§

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>

Builds operation routing once for this service. Read more
Source§

fn event_stream_framing(&self) -> Option<EventStreamFraming<'_>>

Event-frame support, when this protocol supports event streams.
Source§

impl ServerProtocol for RestXml

Source§

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>

The protocol trait’s shape ID, such as aws.protocols#restJson1.
Source§

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

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>

Presents request as a deserializer for input. Read more
Source§

fn serialize_response( &self, output: &Schema<'_>, value: &dyn SerializableStruct, ) -> Response

Serializes value as a complete in-memory response for output. Read more
Source§

fn serialize_streaming_response( &self, output: &Schema<'_>, value: &dyn SerializableStruct, _streaming_member: &Schema<'_>, body: Option<BoxBody>, ) -> Response

Serializes a streaming response for output around a caller-supplied body. Read more
Source§

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

Converts a routing rejection into this protocol’s response. Read more
Source§

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§

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,