pub struct AdTransformCacheLimits { /* private fields */ }Expand description
Retention limits for AD transform graph caches.
The retained-byte limit is a logical payload estimate, not process RSS.
§Examples
use std::num::NonZeroUsize;
use tenferro_ad::AdTransformCacheLimits;
let limits = AdTransformCacheLimits::new(NonZeroUsize::new(4).unwrap());
assert_eq!(limits.max_entries().get(), 4);
assert!(limits.max_retained_bytes().is_some());Implementations§
Source§impl AdTransformCacheLimits
impl AdTransformCacheLimits
Sourcepub fn new(max_entries: NonZeroUsize) -> Self
pub fn new(max_entries: NonZeroUsize) -> Self
Create AD transform cache limits with the default retained-byte bound.
§Examples
use std::num::NonZeroUsize;
use tenferro_ad::AdTransformCacheLimits;
let limits = AdTransformCacheLimits::new(NonZeroUsize::new(2).unwrap());
assert_eq!(limits.max_entries().get(), 2);Sourcepub fn max_entries(self) -> NonZeroUsize
pub fn max_entries(self) -> NonZeroUsize
Return the maximum number of retained AD transform entries.
§Examples
use tenferro_ad::AdTransformCacheLimits;
assert!(AdTransformCacheLimits::default().max_entries().get() > 0);Sourcepub fn max_retained_bytes(self) -> Option<NonZeroUsize>
pub fn max_retained_bytes(self) -> Option<NonZeroUsize>
Return the logical retained-byte bound, when one is configured.
§Examples
use tenferro_ad::AdTransformCacheLimits;
assert!(AdTransformCacheLimits::default().max_retained_bytes().is_some());Sourcepub fn with_max_retained_bytes(self, max_retained_bytes: NonZeroUsize) -> Self
pub fn with_max_retained_bytes(self, max_retained_bytes: NonZeroUsize) -> Self
Return limits with a new logical retained-byte bound.
§Examples
use std::num::NonZeroUsize;
use tenferro_ad::AdTransformCacheLimits;
let limits = AdTransformCacheLimits::default()
.with_max_retained_bytes(NonZeroUsize::new(1024).unwrap());
assert_eq!(limits.max_retained_bytes().unwrap().get(), 1024);Trait Implementations§
Source§impl Clone for AdTransformCacheLimits
impl Clone for AdTransformCacheLimits
Source§fn clone(&self) -> AdTransformCacheLimits
fn clone(&self) -> AdTransformCacheLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AdTransformCacheLimits
impl Debug for AdTransformCacheLimits
Source§impl Default for AdTransformCacheLimits
impl Default for AdTransformCacheLimits
Source§impl PartialEq for AdTransformCacheLimits
impl PartialEq for AdTransformCacheLimits
Source§fn eq(&self, other: &AdTransformCacheLimits) -> bool
fn eq(&self, other: &AdTransformCacheLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for AdTransformCacheLimits
impl Eq for AdTransformCacheLimits
impl StructuralPartialEq for AdTransformCacheLimits
Auto Trait Implementations§
impl Freeze for AdTransformCacheLimits
impl RefUnwindSafe for AdTransformCacheLimits
impl Send for AdTransformCacheLimits
impl Sync for AdTransformCacheLimits
impl Unpin for AdTransformCacheLimits
impl UnsafeUnpin for AdTransformCacheLimits
impl UnwindSafe for AdTransformCacheLimits
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,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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