pub trait Map: UserData {
    type Err: Debug;

    fn map<F, U>(&self, op: F) -> Result<U, Self::Err>
    where
        F: FnOnce(&Self::Target) -> U
; }
Expand description

Trait for wrappers that can be mapped immutably.

Required Associated Types§

Required Methods§

source

fn map<F, U>(&self, op: F) -> Result<U, Self::Err>where
    F: FnOnce(&Self::Target) -> U,

Maps a &T to U. Called for methods that take &self.

Implementations of this method must not panic. Failures should be indicated by returning Err.

Implementors§

source§

impl<T> Map for Aether<T>where
    T: NativeClass + Copy + Default,

source§

impl<T> Map for ArcData<T>where
    T: NativeClass + Send + Sync,

source§

impl<T> Map for LocalCellData<T>where
    T: NativeClass,

source§

impl<T, OPT> Map for MutexData<T, OPT>where
    T: NativeClass + Send,
    OPT: LockOptions,

source§

impl<T, OPT> Map for RwLockData<T, OPT>where
    T: NativeClass + Send + Sync,
    OPT: LockOptions,