Skip to main content

Map

Struct Map 

Source
pub struct Map<'m, M, F> { /* private fields */ }
Expand description

Helper type for PropMap::map. See that method for more information.

Trait Implementations§

Source§

impl<'m, M: Debug, F: Debug> Debug for Map<'m, M, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'m, H, M, F, TargetT> PropMap<H> for Map<'m, M, F>
where H: Handle, M: PropMap<H>, M::Target: 'm, F: Fn(Value<M::Ret<'m>, M::Target>) -> TargetT,

Source§

type Target = TargetT

The owned prop type that this map maps to. Read more
Source§

type Ret<'s> = <Map<'m, M, F> as PropMap<H>>::Target where Self: 's

Return type of Self::get: either Self::Target or &Self::Target.
Source§

fn get(&self, handle: H) -> Option<Value<Self::Ret<'_>, Self::Target>>

Returns the property associated with handle or None if no such property exists. For technical reasons, the returned value is wrapped in Value.
Source§

fn contains_handle(&self, handle: H) -> bool

Returns true if there is a property associated with handle, false otherwise.
Source§

fn map<F, TargetT>(&self, f: F) -> Map<'_, Self, F>
where Self: Sized, F: Fn(Value<Self::Ret<'_>, Self::Target>) -> TargetT,

Creates a new prop map that applies the given function to each element of the original map. Very similar to Iterator::map. Read more

Auto Trait Implementations§

§

impl<'m, M, F> Freeze for Map<'m, M, F>
where F: Freeze,

§

impl<'m, M, F> RefUnwindSafe for Map<'m, M, F>

§

impl<'m, M, F> Send for Map<'m, M, F>
where F: Send, M: Sync,

§

impl<'m, M, F> Sync for Map<'m, M, F>
where F: Sync, M: Sync,

§

impl<'m, M, F> Unpin for Map<'m, M, F>
where F: Unpin,

§

impl<'m, M, F> UnsafeUnpin for Map<'m, M, F>
where F: UnsafeUnpin,

§

impl<'m, M, F> UnwindSafe for Map<'m, M, F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CastFrom<T> for T

Source§

type Fidelity = SameType

Fidelity with which this cast is performed.
Source§

fn cast_from(src: T) -> T

Performs the cast. Read more
Source§

impl<Src, Dst> CastInto<Dst> for Src
where Dst: CastFrom<Src>,

Source§

type Fidelity = <Dst as CastFrom<Src>>::Fidelity

Source§

fn cast_into(self) -> Dst

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,