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 Phase::BeforeSerialization, which has the original input as context. The next phase is Phase::BeforeTransmit, 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 Phase::BeforeTransmit phase is the Phase::BeforeDeserialization phase, which has the raw response available as context. Finally, the Phase::AfterDeserialization phase has both the raw and parsed response available.

To summarize:

  1. Phase::BeforeSerialization: Only has the operation input.
  2. Phase::BeforeTransmit: Only has the serialized request.
  3. Phase::BeforeDeserialization: Has the raw response.
  4. Phase::AfterDeserialization: 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.

Modules

Structs

Type Definitions