Trait MapMut

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

    // Required method
    fn map_mut<F, U>(&self, op: F) -> Result<U, Self::Err>
       where F: FnOnce(&mut Self::Target) -> U;
}
Expand description

Trait for wrappers that can be mapped mutably.

Required Associated Types§

Required Methods§

Source

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

Maps a &mut T to U. Called for methods that take &mut 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> MapMut for LocalCellData<T>
where T: NativeClass,

Source§

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

Source§

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