pub struct PipelineCache {
pub hits: u64,
pub misses: u64,
/* private fields */
}Expand description
A simple pipeline cache mapping PipelineCacheKeys to byte blobs
(mock: stores a label string for each entry).
Fields§
§hits: u64Number of cache hits.
misses: u64Number of cache misses.
Implementations§
Source§impl PipelineCache
impl PipelineCache
Sourcepub fn insert(&mut self, key: PipelineCacheKey, label: impl Into<String>)
pub fn insert(&mut self, key: PipelineCacheKey, label: impl Into<String>)
Insert a pipeline entry.
Sourcepub fn get(&mut self, key: &PipelineCacheKey) -> Option<&str>
pub fn get(&mut self, key: &PipelineCacheKey) -> Option<&str>
Look up a pipeline. Returns Some(&label) on hit, None on miss.
Trait Implementations§
Source§impl Debug for PipelineCache
impl Debug for PipelineCache
Source§impl Default for PipelineCache
impl Default for PipelineCache
Source§fn default() -> PipelineCache
fn default() -> PipelineCache
Returns the “default value” for a type. Read more
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