Trait arc_swap::access::Access[][src]

pub trait Access<T> {
    type Guard: Deref<Target = T>;
    fn load(&self) -> Self::Guard;
}

Abstracts over ways code can get access to a value of type T.

This is the trait that parts of code will use when accessing a subpart of the big data structure. See the module documentation for details.

Associated Types

type Guard: Deref<Target = T>[src]

A guard object containing the value and keeping it alive.

For technical reasons, the library doesn’t allow direct access into the stored value. A temporary guard object must be loaded, that keeps the actual value alive for the time of use.

Loading content...

Required methods

fn load(&self) -> Self::Guard[src]

The loading method.

This returns the guard that holds the actual value. Should be called anew each time a fresh value is needed.

Loading content...

Implementors

impl<A, F, T, R> Access<R> for Map<A, T, F> where
    A: Access<T>,
    F: Fn(&T) -> &R + Clone
[src]

type Guard = MapGuard<A::Guard, F, T, R>

impl<T, A: Access<T>, P: Deref<Target = A>> Access<T> for P[src]

type Guard = A::Guard

impl<T, S: LockStorage> Access<T> for ArcSwapAny<Rc<T>, S>[src]

type Guard = DirectDeref<Rc<T>>

impl<T, S: LockStorage> Access<T> for ArcSwapAny<Arc<T>, S>[src]

type Guard = DirectDeref<Arc<T>>

impl<T: RefCnt, S: LockStorage> Access<T> for ArcSwapAny<T, S>[src]

type Guard = Guard<'static, T>

impl<T: Clone> Access<T> for Constant<T>[src]

type Guard = ConstantDeref<T>

Loading content...