pub struct Policy { /* private fields */ }
Expand description
The policy of a cache.
Implementations
sourceimpl Policy
impl Policy
sourcepub fn max_capacity(&self) -> Option<u64>
pub fn max_capacity(&self) -> Option<u64>
Returns the max_capacity
of the cache.
sourcepub fn num_segments(&self) -> usize
pub fn num_segments(&self) -> usize
Returns the number of internal segments of the cache.
sourcepub fn time_to_live(&self) -> Option<Duration>
pub fn time_to_live(&self) -> Option<Duration>
Returns the time_to_live
of the cache.
sourcepub fn time_to_idle(&self) -> Option<Duration>
pub fn time_to_idle(&self) -> Option<Duration>
Returns the time_to_idle
of the cache.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more