pub struct PipelineCache { /* private fields */ }Expand description
A simple LRU-eviction cache for compiled compute pipelines.
Keyed by a string label; evicts the oldest entry when the capacity is reached.
Implementations§
Source§impl PipelineCache
impl PipelineCache
Sourcepub fn insert(&mut self, key: &str, pipeline: CpuComputeDispatch)
pub fn insert(&mut self, key: &str, pipeline: CpuComputeDispatch)
Insert (or replace) a pipeline under key.
Sourcepub fn get(&self, key: &str) -> Option<&CpuComputeDispatch>
pub fn get(&self, key: &str) -> Option<&CpuComputeDispatch>
Look up a cached pipeline by key.
Auto Trait Implementations§
impl Freeze for PipelineCache
impl RefUnwindSafe for PipelineCache
impl Send for PipelineCache
impl Sync for PipelineCache
impl Unpin for PipelineCache
impl UnsafeUnpin for PipelineCache
impl UnwindSafe for PipelineCache
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> 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