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,
Methods for instances with reference-counted base classes.
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>
pub fn map<F, U>(&self, op: F) -> Result<U, <T::UserData as Map>::Err>
Calls a function with a NativeClass instance and its owner, and returns its return value.
Trait Implementations§
impl<'a, T, U> AsArg<U> for TInstance<'a, T, Shared>
Auto Trait Implementations§
impl<'a, T, Own> Freeze for TInstance<'a, T, Own>
impl<'a, T, Own> RefUnwindSafe for TInstance<'a, T, Own>where
<T as NativeClass>::UserData: RefUnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
Own: RefUnwindSafe,
impl<'a, T, Own> Send for TInstance<'a, T, Own>
impl<'a, T, Own> Sync for TInstance<'a, T, Own>
impl<'a, T, Own> Unpin for TInstance<'a, T, Own>
impl<'a, T, Own> UnwindSafe for TInstance<'a, T, Own>where
<T as NativeClass>::UserData: UnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
Own: UnwindSafe,
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