pub struct RefreshTrigger { /* private fields */ }Expand description
Refresh trigger state and history
Implementations§
Source§impl RefreshTrigger
impl RefreshTrigger
Sourcepub fn new(config: RefreshConfig) -> Self
pub fn new(config: RefreshConfig) -> Self
Create new refresh trigger
Sourcepub fn should_trigger(&self, ttl_consumed_percent: u32) -> bool
pub fn should_trigger(&self, ttl_consumed_percent: u32) -> bool
Check if refresh should be triggered
Sourcepub fn mark_pending(&self)
pub fn mark_pending(&self)
Mark refresh as pending
Sourcepub fn clear_pending(&self)
pub fn clear_pending(&self)
Clear pending flag after refresh completes
Sourcepub fn record_success(&self, duration_ms: u64)
pub fn record_success(&self, duration_ms: u64)
Record successful refresh
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record failed refresh
Sourcepub fn record_check(&self)
pub fn record_check(&self)
Record check attempt
Sourcepub fn last_check_time(&self) -> Option<DateTime<Utc>>
pub fn last_check_time(&self) -> Option<DateTime<Utc>>
Get last check time
Sourcepub fn last_refresh_time(&self) -> Option<DateTime<Utc>>
pub fn last_refresh_time(&self) -> Option<DateTime<Utc>>
Get last refresh time
Sourcepub fn total_refreshes(&self) -> u64
pub fn total_refreshes(&self) -> u64
Get total refreshes count
Sourcepub fn failed_refreshes(&self) -> u64
pub fn failed_refreshes(&self) -> u64
Get failed refreshes count
Sourcepub fn success_rate_percent(&self) -> u32
pub fn success_rate_percent(&self) -> u32
Get success rate percentage
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if refresh is pending
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if refresh enabled
Trait Implementations§
Source§impl Clone for RefreshTrigger
impl Clone for RefreshTrigger
Source§fn clone(&self) -> RefreshTrigger
fn clone(&self) -> RefreshTrigger
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 RefreshTrigger
impl Debug for RefreshTrigger
Auto Trait Implementations§
impl Freeze for RefreshTrigger
impl RefUnwindSafe for RefreshTrigger
impl Send for RefreshTrigger
impl Sync for RefreshTrigger
impl Unpin for RefreshTrigger
impl UnwindSafe for RefreshTrigger
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().