Struct gdnative_core::export::user_data::ArcData
source · pub struct ArcData<T>(_);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>where
T: NativeClass + Send + Sync,
impl<T> UserData for ArcData<T>where
T: NativeClass + Send + Sync,
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