aws_smithy_runtime_api::client::interceptors

Module context

Source
Available on crate feature client only.
Expand description

Interceptor context.

Interceptors have access to varying pieces of context during the course of an operation.

An operation is composed of multiple phases. The initial phase is “before serialization”, which has the original input as context. The next phase is “before transmit”, which has the serialized request as context. Depending on which hook is being called with the dispatch context, the serialized request may or may not be signed (which should be apparent from the hook name). Following the “before transmit” phase is the “before deserialization” phase, which has the raw response available as context. Finally, the “after deserialization” phase has both the raw and parsed response available.

To summarize:

  1. Before serialization: Only has the operation input.
  2. Before transmit: Only has the serialized request.
  3. Before deserialization: Has the raw response.
  4. After deserialization: Has the raw response and the parsed response.

When implementing hooks, if information from a previous phase is required, then implement an earlier hook to examine that context, and save off any necessary information into the ConfigBag for later hooks to examine. Interior mutability is NOT recommended for storing request-specific information in your interceptor implementation. Use the ConfigBag instead.

Structs§

Enums§

Type Aliases§