pub struct AwsJson1_1 { /* private fields */ }Expand description
Stateful schema-driven AWS JSON 1.1 protocol implementation.
Defaults to skipping escape validation in discarded strings.
Set customizationConfig.protocols for this protocol to {"validateSkippedValues":true}
to validate escape syntax without decoding Unicode escapes.
UTF-8, unescaped control characters, and structural syntax remain checked in either mode.
responseBindings defaults to "historical", which keeps what smithy-rs awsJson servers have
always sent: the operation’s @http(code), @httpError statuses and @httpHeader members
as response headers (each also stays in the document). Set it to "smithy-specs" in this
protocol’s settings for the AWS JSON specification instead: always 200 (errors use the
@error class status) with every member in the document and no REST headers.
Trait Implementations§
Source§impl Debug for AwsJson1_1
impl Debug for AwsJson1_1
Source§impl Default for AwsJson1_1
impl Default for AwsJson1_1
Source§impl MetadataRoutedProtocol for AwsJson1_1
impl MetadataRoutedProtocol for AwsJson1_1
Source§fn from_build_context(
ctx: &ProtocolBuildContext<'_>,
) -> Result<Self, RouterBuildError>
fn from_build_context( ctx: &ProtocolBuildContext<'_>, ) -> Result<Self, RouterBuildError>
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>
Source§fn event_stream_framing(&self) -> Option<EventStreamFraming<'_>>
fn event_stream_framing(&self) -> Option<EventStreamFraming<'_>>
Source§impl ServerProtocol for AwsJson1_1
impl ServerProtocol for AwsJson1_1
Source§fn serialize_rejection(&self, err: DeserializeError) -> Response
fn serialize_rejection(&self, err: DeserializeError) -> Response
awsJson’s From<RequestRejection> collapses every transport failure, Accept
and Content-Type mismatches included, into a 400 Serialization; routing
through that same From preserves the collapse. A constraint violation answers
with the modeled validation error.
Source§fn protocol_id(&self) -> &'static ShapeId<'static>
fn protocol_id(&self) -> &'static ShapeId<'static>
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>
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
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
Source§fn serialize_routing_error(&self, err: &RoutingError) -> Response
fn serialize_routing_error(&self, err: &RoutingError) -> Response
Source§fn serialize_runtime_error(&self, error: RuntimeError) -> Response
fn serialize_runtime_error(&self, error: RuntimeError) -> Response
Auto Trait Implementations§
impl Freeze for AwsJson1_1
impl RefUnwindSafe for AwsJson1_1
impl Send for AwsJson1_1
impl Sync for AwsJson1_1
impl Unpin for AwsJson1_1
impl UnsafeUnpin for AwsJson1_1
impl UnwindSafe for AwsJson1_1
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<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