pub struct RpcV2Cbor { /* private fields */ }Expand description
Stateful schema-driven Smithy RPC v2 CBOR protocol implementation.
Non-POST requests return 405 by default. Set the boolean
customizationConfig.protocols["smithy.protocols#rpcv2Cbor"].methodNotAllowedAsNotFound
to true to return the Java server’s unknown-operation 404 instead.
Trait Implementations§
Source§impl MetadataRoutedProtocol for RpcV2Cbor
impl MetadataRoutedProtocol for RpcV2Cbor
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 RpcV2Cbor
impl ServerProtocol for RpcV2Cbor
Source§fn serialize_routing_error(&self, err: &RoutingError) -> Response
fn serialize_routing_error(&self, err: &RoutingError) -> Response
Method mismatches return the generated serde server’s bare 405 by default. The
methodNotAllowedAsNotFound setting selects the unknown-operation 404 instead.
Unsupported operations return an empty 501. Every other routing rejection, including
framing violations such as a forbidden x-amz-target/x-amzn-target header or an invalid
smithy-protocol value, returns the generated serde empty 404 for a single-protocol service.
Multi-protocol services serialize the CBOR unknown-operation error after claiming.
Source§fn serialize_rejection(&self, err: DeserializeError) -> Response
fn serialize_rejection(&self, err: DeserializeError) -> Response
rpcv2Cbor’s From<RequestRejection> collapses every transport failure into a 400
Serialization (body 0xa0, no __type, upstream #3716, and no smithy-protocol
header). A constraint violation serializes the modeled validation error, __type first,
full shape ID, but through the response engine directly rather than
Self::serialize_error: rejection responses must NOT carry the smithy-protocol
header, which is reserved for handler-returned responses. An invalid initial request
frame uses the shared validation error’s CBOR encoding.
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_runtime_error(&self, error: RuntimeError) -> Response
fn serialize_runtime_error(&self, error: RuntimeError) -> Response
Auto Trait Implementations§
impl Freeze for RpcV2Cbor
impl RefUnwindSafe for RpcV2Cbor
impl Send for RpcV2Cbor
impl Sync for RpcV2Cbor
impl Unpin for RpcV2Cbor
impl UnsafeUnpin for RpcV2Cbor
impl UnwindSafe for RpcV2Cbor
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