pub struct CustomizableOperation<T, E, B> { /* private fields */ }
Expand description
CustomizableOperation
allows for configuring a single operation invocation before it is sent.
Implementations§
Source§impl<T, E, B> CustomizableOperation<T, E, B>
impl<T, E, B> CustomizableOperation<T, E, B>
Sourcepub fn interceptor(self, interceptor: impl Intercept + 'static) -> Self
pub fn interceptor(self, interceptor: impl Intercept + 'static) -> Self
Adds an interceptor that runs at specific stages of the request execution pipeline.
Note that interceptors can also be added to CustomizableOperation
by config_override
,
map_request
, and mutate_request
(the last two are implemented via interceptors under the hood).
The order in which those user-specified operation interceptors are invoked should not be relied upon
as it is an implementation detail.
Sourcepub fn map_request<F, MapE>(self, f: F) -> Selfwhere
F: Fn(HttpRequest) -> Result<HttpRequest, MapE> + Send + Sync + 'static,
MapE: Error + Send + Sync + 'static,
pub fn map_request<F, MapE>(self, f: F) -> Selfwhere
F: Fn(HttpRequest) -> Result<HttpRequest, MapE> + Send + Sync + 'static,
MapE: Error + Send + Sync + 'static,
Allows for customizing the operation’s request.
Sourcepub fn mutate_request<F>(self, f: F) -> Self
pub fn mutate_request<F>(self, f: F) -> Self
Convenience for map_request
where infallible direct mutation of request is acceptable.
Sourcepub fn config_override(self, config_override: impl Into<Builder>) -> Self
pub fn config_override(self, config_override: impl Into<Builder>) -> Self
Overrides config for a single operation invocation.
config_override
is applied to the operation configuration level.
The fields in the builder that are Some
override those applied to the service
configuration level. For instance,
Config A | overridden by Config B | = Config C |
---|---|---|
field_1: None, | field_1: Some(v2), | field_1: Some(v2), |
field_2: Some(v1), | field_2: Some(v2), | field_2: Some(v2), |
field_3: Some(v1), | field_3: None, | field_3: Some(v1), |