Trait gdnative::export::user_data::Map

pub trait Map: UserData {
    type Err: Error;

    // 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§

type Err: Error

Required Methods§

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.

Object Safety§

This trait is not object safe.

Implementors§

§

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

§

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

§

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

§

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

§

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