pub struct Map<A, T, F> { /* private fields */ }
Expand description
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§
source§impl<A, T, F> Map<A, T, F>
impl<A, T, F> Map<A, T, F>
sourcepub fn new<R>(access: A, projection: F) -> Self
pub fn new<R>(access: A, projection: F) -> Self
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: Copy, T: Copy, F: Copy> Copy for Map<A, T, F>
Auto Trait Implementations§
impl<A, T, F> Freeze for Map<A, T, F>
impl<A, T, F> RefUnwindSafe for Map<A, T, F>where
A: RefUnwindSafe,
F: RefUnwindSafe,
impl<A, T, F> Send for Map<A, T, F>
impl<A, T, F> Sync for Map<A, T, F>
impl<A, T, F> Unpin for Map<A, T, F>
impl<A, T, F> UnwindSafe for Map<A, T, F>where
A: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load
.