pub struct RotationCache { /* private fields */ }Expand description
A small (seed, dim)-keyed LRU cache over RotationMatrix values.
Implementations§
Source§impl RotationCache
impl RotationCache
Sourcepub const fn new(capacity: usize) -> Self
pub const fn new(capacity: usize) -> Self
Construct a new cache with the given capacity.
A capacity of 0 is legal but makes every lookup a miss.
Sourcepub const fn default_sized() -> Self
pub const fn default_sized() -> Self
Construct the default-sized cache (capacity DEFAULT_CAPACITY).
Sourcepub fn get_or_build(&self, seed: u64, dimension: u32) -> RotationMatrix
pub fn get_or_build(&self, seed: u64, dimension: u32) -> RotationMatrix
Return the rotation matrix for (seed, dimension), building and
caching one on miss. Returned values are Arc-backed clones, so
the caller never blocks subsequent users of the cache.
Trait Implementations§
Source§impl Debug for RotationCache
impl Debug for RotationCache
Auto Trait Implementations§
impl !Freeze for RotationCache
impl !RefUnwindSafe for RotationCache
impl Send for RotationCache
impl Sync for RotationCache
impl Unpin for RotationCache
impl UnsafeUnpin for RotationCache
impl UnwindSafe for RotationCache
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