pub struct FragmentCache { /* private fields */ }Expand description
The unified fragment cache.
Implementations§
Source§impl FragmentCache
impl FragmentCache
Sourcepub fn new(config: CacheConfig) -> Self
pub fn new(config: CacheConfig) -> Self
Creates a new cache with the given configuration.
Sourcepub fn config(&self) -> &CacheConfig
pub fn config(&self) -> &CacheConfig
Returns the configuration.
Sourcepub fn access(&self, fragment_id: &str) -> CacheTier
pub fn access(&self, fragment_id: &str) -> CacheTier
Records a cache access, returning the tier.
Sourcepub fn insert(
&self,
fragment_id: impl Into<String>,
size: u64,
tier: CacheTier,
for_infernum: bool,
)
pub fn insert( &self, fragment_id: impl Into<String>, size: u64, tier: CacheTier, for_infernum: bool, )
Inserts a fragment into the cache.
Sourcepub fn promote(&self, fragment_id: &str, to_tier: CacheTier)
pub fn promote(&self, fragment_id: &str, to_tier: CacheTier)
Promotes a fragment to a higher tier.
Sourcepub fn demote(&self, fragment_id: &str, to_tier: CacheTier)
pub fn demote(&self, fragment_id: &str, to_tier: CacheTier)
Demotes a fragment to a lower tier.
Marks a fragment as used by both systems (shared).
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Returns current statistics.
Auto Trait Implementations§
impl !Freeze for FragmentCache
impl !RefUnwindSafe for FragmentCache
impl Send for FragmentCache
impl Sync for FragmentCache
impl Unpin for FragmentCache
impl UnwindSafe for FragmentCache
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