Skip to main content

ResolveCachedIdentity

Trait ResolveCachedIdentity 

Source
pub trait ResolveCachedIdentity:
    Debug
    + Send
    + Sync {
    // Required method
    fn resolve_cached_identity<'a>(
        &'a self,
        resolver: SharedIdentityResolver,
        runtime_components: &'a RuntimeComponents,
        config_bag: &'a ConfigBag,
    ) -> IdentityFuture<'a>;

    // Provided methods
    fn invalidate(&self, rejected: &Identity) { ... }
    fn validate_base_client_config(
        &self,
        runtime_components: &RuntimeComponentsBuilder,
        cfg: &ConfigBag,
    ) -> Result<(), Box<dyn Error + Send + Sync>> { ... }
    fn validate_final_config(
        &self,
        runtime_components: &RuntimeComponents,
        cfg: &ConfigBag,
    ) -> Result<(), Box<dyn Error + Send + Sync>> { ... }
}
Expand description

Caching resolver for identities.

Required Methods§

Source

fn resolve_cached_identity<'a>( &'a self, resolver: SharedIdentityResolver, runtime_components: &'a RuntimeComponents, config_bag: &'a ConfigBag, ) -> IdentityFuture<'a>

Returns a cached identity, or resolves an identity and caches it if its not already cached.

Provided Methods§

Source

fn invalidate(&self, rejected: &Identity)

Marks the cached identity for refresh.

The default implementation is a no-op; caches override it to support invalidation.

Source

fn validate_base_client_config( &self, runtime_components: &RuntimeComponentsBuilder, cfg: &ConfigBag, ) -> Result<(), Box<dyn Error + Send + Sync>>

Validate the base client configuration.

This gets called upon client construction. The full config may not be available at this time (hence why it has RuntimeComponentsBuilder as an argument rather than RuntimeComponents). Any error returned here will become a panic in the client constructor.

Source

fn validate_final_config( &self, runtime_components: &RuntimeComponents, cfg: &ConfigBag, ) -> Result<(), Box<dyn Error + Send + Sync>>

Validate the final client configuration.

This gets called immediately after the Intercept::read_before_execution trait hook when the final configuration has been resolved. Any error returned here will cause the operation to return that error.

Implementations on Foreign Types§

Source§

impl ResolveCachedIdentity for StaticStabilityCache

Source§

fn validate_base_client_config( &self, runtime_components: &RuntimeComponentsBuilder, _cfg: &ConfigBag, ) -> Result<(), Box<dyn Error + Send + Sync>>

Source§

fn validate_final_config( &self, runtime_components: &RuntimeComponents, _cfg: &ConfigBag, ) -> Result<(), Box<dyn Error + Send + Sync>>

Source§

fn resolve_cached_identity<'a>( &'a self, resolver: SharedIdentityResolver, runtime_components: &'a RuntimeComponents, config_bag: &'a ConfigBag, ) -> IdentityFuture<'a>

Source§

fn invalidate(&self, rejected: &Identity)

Implementors§