pub struct ProviderCacheState { /* private fields */ }Expand description
Tracks which sections have been sent to the provider.
Implementations§
Source§impl ProviderCacheState
impl ProviderCacheState
pub fn new() -> Self
Sourcepub fn needs_update(&self, section: &CacheableSection) -> bool
pub fn needs_update(&self, section: &CacheableSection) -> bool
Check if a section has changed since last sent.
Sourcepub fn mark_sent(&mut self, section: &CacheableSection)
pub fn mark_sent(&mut self, section: &CacheableSection)
Mark a section as sent to the provider.
Sourcepub fn filter_changed<'a>(
&mut self,
sections: &'a [CacheableSection],
) -> Vec<&'a CacheableSection>
pub fn filter_changed<'a>( &mut self, sections: &'a [CacheableSection], ) -> Vec<&'a CacheableSection>
Filter sections to only include those that changed. Stable sections that haven’t changed can be skipped (provider caches them).
pub fn cache_hit_rate(&self) -> f64
pub fn reset(&mut self)
Trait Implementations§
Source§impl Debug for ProviderCacheState
impl Debug for ProviderCacheState
Auto Trait Implementations§
impl Freeze for ProviderCacheState
impl RefUnwindSafe for ProviderCacheState
impl Send for ProviderCacheState
impl Sync for ProviderCacheState
impl Unpin for ProviderCacheState
impl UnsafeUnpin for ProviderCacheState
impl UnwindSafe for ProviderCacheState
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> 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 more