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
sourceimpl<'a, T: NativeClass, Own: Ownership> TInstance<'a, T, Own>
impl<'a, T: NativeClass, Own: Ownership> TInstance<'a, T, Own>
sourceimpl<'a, T: NativeClass, Own: NonUniqueOwnership> TInstance<'a, T, Own>
impl<'a, T: NativeClass, Own: NonUniqueOwnership> TInstance<'a, T, Own>
sourceimpl<'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.
Trait Implementations
sourceimpl<'a, T, Own: Ownership> Clone for TInstance<'a, T, Own> where
T: NativeClass,
impl<'a, T, Own: Ownership> Clone for TInstance<'a, T, Own> where
T: NativeClass,
sourceimpl<'a, T: Debug + NativeClass, Own: Debug + Ownership> Debug for TInstance<'a, T, Own> where
T::Base: Debug,
T::UserData: Debug,
impl<'a, T: Debug + NativeClass, Own: Debug + Ownership> Debug for TInstance<'a, T, Own> where
T::Base: Debug,
T::UserData: Debug,
impl<'a, T, U> AsArg<U> for TInstance<'a, T, Shared> where
T: NativeClass,
T::Base: GodotObject + SubClass<U>,
T::UserData: Map,
U: GodotObject,
Auto Trait Implementations
impl<'a, T, Own> RefUnwindSafe for TInstance<'a, T, Own> where
Own: RefUnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
<T as NativeClass>::UserData: RefUnwindSafe,
impl<'a, T, Own> Send for TInstance<'a, T, Own> where
Own: Send,
<T as NativeClass>::Base: Sync,
<T as NativeClass>::UserData: Send,
impl<'a, T, Own> Sync for TInstance<'a, T, Own> where
Own: Sync,
<T as NativeClass>::Base: Sync,
<T as NativeClass>::UserData: Sync,
impl<'a, T, Own> Unpin for TInstance<'a, T, Own> where
Own: Unpin,
<T as NativeClass>::UserData: Unpin,
impl<'a, T, Own> UnwindSafe for TInstance<'a, T, Own> where
Own: UnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
<T as NativeClass>::UserData: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more