Trait DirectCacheAccess

Source
pub trait DirectCacheAccess<T, E> {
    // Required methods
    fn get_value_mut(&mut self) -> Option<&mut T>;
    fn get_value(&self) -> Option<&T>;
    fn get_result(&self) -> Option<Result<&T, &E>>;
    fn take_value(&mut self) -> Option<T>;
    fn take_result(&mut self) -> Option<Result<T, E>>;
}
Expand description

Trait for directly accessing the cache underneath any promise

Required Methods§

Source

fn get_value_mut(&mut self) -> Option<&mut T>

returns mutable reference to the cache if applicable

Source

fn get_value(&self) -> Option<&T>

returns a reference to the cache if applicable

Source

fn get_result(&self) -> Option<Result<&T, &E>>

returns a reference to the cache or to error if applicable

Source

fn take_value(&mut self) -> Option<T>

takes the value and leaves the promise in a valid state indicating its emptiness

Source

fn take_result(&mut self) -> Option<Result<T, E>>

takes the value or error and leaves the promise in a valid state indicating its emptiness

Implementations on Foreign Types§

Source§

impl<T: Send + 'static, E: Send + 'static, A: DirectCacheAccess<T, E>> DirectCacheAccess<T, E> for Option<A>

Blanket implementation for any Option<DirectCacheAccess<T>> allows for better handling of option-laziness

Source§

fn get_value_mut(&mut self) -> Option<&mut T>

Source§

fn get_value(&self) -> Option<&T>

Source§

fn get_result(&self) -> Option<Result<&T, &E>>

Source§

fn take_value(&mut self) -> Option<T>

Source§

fn take_result(&mut self) -> Option<Result<T, E>>

Implementors§