Module aws_smithy_http_server::extension
source · Expand description
Extension types.
Extension types are types that are stored in and extracted from both requests and responses.
There is only one generic extension type for requests, Extension
.
On the other hand, the server SDK uses multiple concrete extension types for responses in order
to store a variety of information, like the operation that was executed, the operation error
that got returned, or the runtime error that happened, among others. The information stored in
these types may be useful to [tower::Layer
]s that post-process the response: for instance, a
particular metrics layer implementation might want to emit metrics about the number of times an
an operation got executed.
Re-exports§
pub use crate::request::extension::Extension;
pub use crate::request::extension::MissingExtension;
Structs§
- Extension type used to store the type of user-modeled error returned by an operation handler. These are modeled errors, defined in the Smithy model.
- Extension type used to store information about Smithy operations in HTTP responses. This extension type is inserted, via the
OperationExtensionPlugin
, whenever it has been correctly determined that the request should be routed to a particular operation. The operation handler might not even get invoked because the request fails to deserialize into the modeled operation input. - The [
Service::Future
] ofOperationExtensionService
- inserts anOperationExtension
into the [http::Response]
. - A
Plugin
which appliesOperationExtensionService
to every operation. - Inserts a
OperationExtension
into the extensions of thehttp::Response
. - Extension type used to store the name of the possible runtime errors. These are unmodeled errors; the operation handler was not invoked.
Enums§
- An error occurred when parsing an absolute operation shape ID.
Traits§
- An extension trait on
HttpPlugins
allowing the application ofOperationExtensionPlugin
.