Trait Map

Source
pub trait Map: UserData {
    type Err: Debug;

    // Required method
    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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

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,