#[non_exhaustive]pub struct TokenRefreshConfig {
pub expiration_refresh_ratio: f64,
pub retry_config: RetryConfig,
}Available on crate feature
token-based-authentication only.Expand description
Configuration for token refresh behavior
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.expiration_refresh_ratio: f64Fraction of token lifetime after which refresh should be triggered (0.0 to 1.0). For example, 0.8 means refresh when 80% of the token’s lifetime has elapsed.
retry_config: RetryConfigRetry configuration for failed refresh attempts
Implementations§
Source§impl TokenRefreshConfig
impl TokenRefreshConfig
Sourcepub fn set_expiration_refresh_ratio(self, ratio: f64) -> Self
pub fn set_expiration_refresh_ratio(self, ratio: f64) -> Self
Set the expiration refresh ratio
Sourcepub fn set_retry_config(self, retry_config: RetryConfig) -> Self
pub fn set_retry_config(self, retry_config: RetryConfig) -> Self
Set the retry configuration
Trait Implementations§
Source§impl Clone for TokenRefreshConfig
impl Clone for TokenRefreshConfig
Source§fn clone(&self) -> TokenRefreshConfig
fn clone(&self) -> TokenRefreshConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenRefreshConfig
impl Debug for TokenRefreshConfig
Auto Trait Implementations§
impl Freeze for TokenRefreshConfig
impl RefUnwindSafe for TokenRefreshConfig
impl Send for TokenRefreshConfig
impl Sync for TokenRefreshConfig
impl Unpin for TokenRefreshConfig
impl UnwindSafe for TokenRefreshConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more