pub struct ArcData<T>(/* private fields */);
Expand description
User-data wrapper encapsulating a Arc<T>
. Does not implement MapMut
.
Implementations§
Source§impl<T> ArcData<T>
impl<T> ArcData<T>
Sourcepub fn into_inner(self) -> Arc<T>
pub fn into_inner(self) -> Arc<T>
Returns the internal Arc<T>
. Useful for API’s that require an Arc
directly, or for coercing it into a trait object.
Note that this removes
the restriction of only being able to access the NativeClass
instance
temporarily through the Map
trait; however, it should be exactly as safe
as permanently storing an owned ArcData
and then calling .map()
on
it later.
Trait Implementations§
Source§impl<T> UserData for ArcData<T>
impl<T> UserData for ArcData<T>
type Target = T
Source§fn new(val: Self::Target) -> Self
fn new(val: Self::Target) -> Self
Creates a new owned wrapper from a
NativeClass
instance. Read moreSource§fn 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
Auto Trait Implementations§
impl<T> Freeze for ArcData<T>
impl<T> RefUnwindSafe for ArcData<T>where
T: RefUnwindSafe,
impl<T> Send for ArcData<T>
impl<T> Sync for ArcData<T>
impl<T> Unpin for ArcData<T>
impl<T> UnwindSafe for ArcData<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more