Trait lunatic_cached_process::CachedLookup
source · pub trait CachedLookup<'a, T> {
// Required methods
fn get(&'a self) -> Option<T>;
fn set(&'a self, value: T);
fn reset(&'a self);
}Expand description
Trait for accessing a static process local cache.
Required Methods§
sourcefn get(&'a self) -> Option<T>
fn get(&'a self) -> Option<T>
Looks up a process by its name, and caches the result. Subsequent calls will used the cached value.
sourcefn set(&'a self, value: T)
fn set(&'a self, value: T)
Sets the cached lookup. This will prevent any lookups from being made,
since subsequent calls to CachedLookup::get will return this cached value.
sourcefn reset(&'a self)
fn reset(&'a self)
Resets the cache, causing the next call to CachedLookup::get to lookup the process again.