Struct gdnative_core::object::TInstance
source · pub struct TInstance<'a, T: NativeClass, Own: Ownership = Shared> { /* private fields */ }
Expand description
A reference to a GodotObject with a rust NativeClass attached that is assumed safe during a certain lifetime.
See the type-level documentation on Ref
for more information on typed thread accesses.
Implementations§
source§impl<'a, T: NativeClass, Own: Ownership> TInstance<'a, T, Own>
impl<'a, T: NativeClass, Own: Ownership> TInstance<'a, T, Own>
source§impl<'a, T: NativeClass, Own: NonUniqueOwnership> TInstance<'a, T, Own>
impl<'a, T: NativeClass, Own: NonUniqueOwnership> TInstance<'a, T, Own>
source§impl<'a, T: NativeClass, Own: Ownership> TInstance<'a, T, Own>where
T::Base: GodotObject,
impl<'a, T: NativeClass, Own: Ownership> TInstance<'a, T, Own>where
T::Base: GodotObject,
Methods for instances with reference-counted base classes.
sourcepub fn map<F, U>(&self, op: F) -> Result<U, <T::UserData as Map>::Err>where
T::UserData: Map,
F: FnOnce(&T, TRef<'_, T::Base, Own>) -> U,
pub fn map<F, U>(&self, op: F) -> Result<U, <T::UserData as Map>::Err>where
T::UserData: Map,
F: FnOnce(&T, TRef<'_, T::Base, Own>) -> U,
Calls a function with a NativeClass instance and its owner, and returns its return value.