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

ModeledErrorExtension
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.
OperationExtension
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.
OperationExtensionFuture
The [Service::Future] of OperationExtensionService - inserts an OperationExtension into the [http::Response].
OperationExtensionPlugin
A Plugin which applies OperationExtensionService to every operation.
OperationExtensionService
Inserts a OperationExtension into the extensions of the http::Response.
RuntimeErrorExtension
Extension type used to store the name of the possible runtime errors. These are unmodeled errors; the operation handler was not invoked.

Enums§

ParseError
An error occurred when parsing an absolute operation shape ID.

Traits§

OperationExtensionExt
An extension trait on HttpPlugins allowing the application of OperationExtensionPlugin.