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§
Sourcefn get_value_mut(&mut self) -> Option<&mut T>
fn get_value_mut(&mut self) -> Option<&mut T>
returns mutable reference to the cache if applicable
Sourcefn get_result(&self) -> Option<Result<&T, &E>>
fn get_result(&self) -> Option<Result<&T, &E>>
returns a reference to the cache or to error if applicable
Sourcefn take_value(&mut self) -> Option<T>
fn take_value(&mut self) -> Option<T>
takes the value and leaves the promise in a valid state indicating its emptiness
Sourcefn take_result(&mut self) -> Option<Result<T, E>>
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
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