Struct arc_swap::access::Map [−][src]
An adaptor to provide access to a part of larger structure.
This is the active part of this module. Use the module documentation for the details.
Implementations
impl<A, T, F> Map<A, T, F>
[src]
pub fn new<R>(access: A, projection: F) -> Self where
F: Fn(&T) -> &R + Clone,
[src]
F: Fn(&T) -> &R + Clone,
Creates a new instance.
Parameters
access
: Access to the bigger structure. This is usually something likeArc<ArcSwap>
or&ArcSwap
. It is technically possible to use any otherAccess
here, though, for example to sub-delegate into even smaller structure from aMap
(or genericAccess
).projection
: A function (or closure) responsible to providing a reference into the bigger bigger structure, selecting just subset of it. In general, it is expected to be cheap (like only taking reference).
Trait Implementations
impl<A, F, T, R> Access<R> for Map<A, T, F> where
A: Access<T>,
F: Fn(&T) -> &R + Clone,
[src]
A: Access<T>,
F: Fn(&T) -> &R + Clone,
type Guard = MapGuard<A::Guard, F, T, R>
A guard object containing the value and keeping it alive. Read more
fn load(&self) -> Self::Guard
[src]
impl<A: Clone, T: Clone, F: Clone> Clone for Map<A, T, F>
[src]
impl<A: Copy, T: Copy, F: Copy> Copy for Map<A, T, F>
[src]
impl<A: Debug, T: Debug, F: Debug> Debug for Map<A, T, F>
[src]
Auto Trait Implementations
impl<A, T, F> RefUnwindSafe for Map<A, T, F> where
A: RefUnwindSafe,
F: RefUnwindSafe,
A: RefUnwindSafe,
F: RefUnwindSafe,
impl<A, T, F> Send for Map<A, T, F> where
A: Send,
F: Send,
A: Send,
F: Send,
impl<A, T, F> Sync for Map<A, T, F> where
A: Sync,
F: Sync,
A: Sync,
F: Sync,
impl<A, T, F> Unpin for Map<A, T, F> where
A: Unpin,
F: Unpin,
A: Unpin,
F: Unpin,
impl<A, T, F> UnwindSafe for Map<A, T, F> where
A: UnwindSafe,
F: UnwindSafe,
A: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, A> DynAccess<T> for A where
A: Access<T>,
<A as Access<T>>::Guard: 'static,
[src]
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,