Struct bonsaidb::keystorage::s3::aws_sdk_s3::config::interceptors::InterceptorContext
pub struct InterceptorContext<I = Input, O = Output, E = Error> { /* private fields */ }
Expand description
A container for the data currently available to an interceptor.
Different context is available based on which phase the operation is currently in. For example,
context in the “before serialization” phase won’t have a request
yet since the input hasn’t been
serialized at that point. But once it gets into the “before transmit” phase, the request
will be set.
Implementations§
§impl InterceptorContext<Input, Output, Error>
impl InterceptorContext<Input, Output, Error>
pub fn new(input: Input) -> InterceptorContext<Input, Output, Error>
pub fn new(input: Input) -> InterceptorContext<Input, Output, Error>
Creates a new interceptor context in the “before serialization” phase.
§impl<I, O, E> InterceptorContext<I, O, E>
impl<I, O, E> InterceptorContext<I, O, E>
pub fn take_input(&mut self) -> Option<I>
pub fn take_input(&mut self) -> Option<I>
Takes ownership of the input.
pub fn set_request(&mut self, request: Request<SdkBody>)
pub fn set_request(&mut self, request: Request<SdkBody>)
Set the request for the operation being invoked.
pub fn request(&self) -> Option<&Request<SdkBody>>
pub fn request(&self) -> Option<&Request<SdkBody>>
Retrieve the transmittable request for the operation being invoked. This will only be available once request marshalling has completed.
pub fn request_mut(&mut self) -> Option<&mut Request<SdkBody>>
pub fn request_mut(&mut self) -> Option<&mut Request<SdkBody>>
Retrieve the transmittable request for the operation being invoked. This will only be available once request marshalling has completed.
pub fn take_request(&mut self) -> Option<Request<SdkBody>>
pub fn take_request(&mut self) -> Option<Request<SdkBody>>
Takes ownership of the request.
pub fn set_response(&mut self, response: Response<SdkBody>)
pub fn set_response(&mut self, response: Response<SdkBody>)
Set the response for the operation being invoked.
pub fn response_mut(&mut self) -> Option<&mut Response<SdkBody>>
pub fn response_mut(&mut self) -> Option<&mut Response<SdkBody>>
Returns a mutable reference to the response.
pub fn set_output_or_error(&mut self, output: Result<O, OrchestratorError<E>>)
pub fn set_output_or_error(&mut self, output: Result<O, OrchestratorError<E>>)
Set the output or error for the operation being invoked.
pub fn output_or_error(&self) -> Option<Result<&O, &OrchestratorError<E>>>
pub fn output_or_error(&self) -> Option<Result<&O, &OrchestratorError<E>>>
Returns the deserialized output or error.
pub fn output_or_error_mut(
&mut self
) -> Option<&mut Result<O, OrchestratorError<E>>>
pub fn output_or_error_mut( &mut self ) -> Option<&mut Result<O, OrchestratorError<E>>>
Returns the mutable reference to the deserialized output or error.
§impl<I, O, E> InterceptorContext<I, O, E>where
E: Debug,
impl<I, O, E> InterceptorContext<I, O, E>where E: Debug,
pub fn fail(&mut self, error: OrchestratorError<E>)
pub fn fail(&mut self, error: OrchestratorError<E>)
Mark this context as failed due to errors during the operation. Any errors already contained by the context will be replaced by the given error.