pub struct MutexData<T, OPT = DefaultLockPolicy> { /* private fields */ }
Expand description
User-data wrapper encapsulating a Arc<Mutex<T>>
.
The underlying Mutex
may change in the future. The current implementation is
parking_lot
.
Trait Implementations
sourceimpl<T, OPT> Map for MutexData<T, OPT>where
T: NativeClass + Send,
OPT: LockOptions,
impl<T, OPT> Map for MutexData<T, OPT>where
T: NativeClass + Send,
OPT: LockOptions,
type Err = LockFailed
sourceimpl<T, OPT> MapMut for MutexData<T, OPT>where
T: NativeClass + Send,
OPT: LockOptions,
impl<T, OPT> MapMut for MutexData<T, OPT>where
T: NativeClass + Send,
OPT: LockOptions,
type Err = LockFailed
sourceimpl<T, OPT> UserData for MutexData<T, OPT>where
T: NativeClass + Send,
OPT: LockOptions,
impl<T, OPT> UserData for MutexData<T, OPT>where
T: NativeClass + Send,
OPT: LockOptions,
type Target = T
sourcefn new(val: Self::Target) -> Self
fn new(val: Self::Target) -> Self
Creates a new owned wrapper from a
NativeClass
instance. Read moresourcefn into_user_data(self) -> *const c_void
fn into_user_data(self) -> *const c_void
Takes a native instance and returns an opaque pointer that can be used to recover it. Read more
sourceunsafe fn consume_user_data_unchecked(ptr: *const c_void) -> Self
unsafe fn consume_user_data_unchecked(ptr: *const c_void) -> Self
Takes an opaque pointer produced by
into_user_data
and “consumes” it to produce the
original instance, keeping the reference count. Read moresourceunsafe fn clone_from_user_data_unchecked(ptr: *const c_void) -> Self
unsafe fn clone_from_user_data_unchecked(ptr: *const c_void) -> Self
Takes an opaque pointer produced by
into_user_data
and “clones” it to produce the
original instance, increasing the reference count. Read moreAuto Trait Implementations
impl<T, OPT = DefaultLockPolicy> !RefUnwindSafe for MutexData<T, OPT>
impl<T, OPT> Send for MutexData<T, OPT>where
OPT: Send,
T: Send,
impl<T, OPT> Sync for MutexData<T, OPT>where
OPT: Sync,
T: Send,
impl<T, OPT> Unpin for MutexData<T, OPT>where
OPT: Unpin,
impl<T, OPT = DefaultLockPolicy> !UnwindSafe for MutexData<T, OPT>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more