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§

source

fn get(&'a self) -> Option<T>

Looks up a process by its name, and caches the result. Subsequent calls will used the cached value.

source

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.

source

fn reset(&'a self)

Resets the cache, causing the next call to CachedLookup::get to lookup the process again.

Implementations on Foreign Types§

source§

impl<T, S> CachedLookup<'static, Process<T, S>> for ProcessLocal<ProcessCached<'_, T, S>>

source§

fn get(&'static self) -> Option<Process<T, S>>

source§

fn set(&'static self, value: Process<T, S>)

source§

fn reset(&'static self)

source§

impl<T> CachedLookup<'static, ProcessRef<T>> for ProcessLocal<ProcessRefCached<'_, T>>

source§

fn get(&'static self) -> Option<ProcessRef<T>>

source§

fn set(&'static self, value: ProcessRef<T>)

source§

fn reset(&'static self)

Implementors§

source§

impl<T> CachedLookup<'static, ProcessRef<T>> for ProcessRefCached<'_, T>

source§

impl<T, S> CachedLookup<'static, Process<T, S>> for ProcessCached<'_, T, S>