[−][src]Struct gdnative_core::nativescript::class::RefInstance
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
impl<'a, T: NativeClass, Access: ThreadAccess> RefInstance<'a, T, Access>
[src]
pub fn base(&self) -> TRef<'a, T::Base, Access>
[src]
Returns a reference to the base object with the same lifetime.
pub fn script(&self) -> &T::UserData
[src]
Returns a reference to the script wrapper.
pub fn try_from_base(owner: TRef<'a, T::Base, Access>) -> Option<Self>
[src]
Try to downcast TRef<'a, T::Base, Access>
to RefInstance<T>
.
impl<'a, T: NativeClass, Access: ThreadAccess> RefInstance<'a, T, Access> where
T::Base: GodotObject,
[src]
T::Base: GodotObject,
Methods for instances with reference-counted base classes.
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, Access>) -> U,
[src]
T::UserData: Map,
F: FnOnce(&T, TRef<T::Base, Access>) -> U,
Calls a function with a NativeClass instance and its owner, and returns its return value.
pub fn map_mut<F, U>(&self, op: F) -> Result<U, <T::UserData as MapMut>::Err> where
T::UserData: MapMut,
F: FnOnce(&mut T, TRef<T::Base, Access>) -> U,
[src]
T::UserData: MapMut,
F: FnOnce(&mut T, TRef<T::Base, Access>) -> U,
Calls a function with a NativeClass instance and its owner, and returns its return value.
Trait Implementations
impl<'a, T, Access: ThreadAccess> Clone for RefInstance<'a, T, Access> where
T: NativeClass,
[src]
T: NativeClass,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, T: Debug + NativeClass, Access: Debug + ThreadAccess> Debug for RefInstance<'a, T, Access> where
T::Base: Debug,
T::UserData: Debug,
[src]
T::Base: Debug,
T::UserData: Debug,
Auto Trait Implementations
impl<'a, T, Access> RefUnwindSafe for RefInstance<'a, T, Access> where
Access: RefUnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
<T as NativeClass>::UserData: RefUnwindSafe,
Access: RefUnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
<T as NativeClass>::UserData: RefUnwindSafe,
impl<'a, T, Access> Send for RefInstance<'a, T, Access> where
Access: Send,
<T as NativeClass>::Base: Sync,
<T as NativeClass>::UserData: Send,
Access: Send,
<T as NativeClass>::Base: Sync,
<T as NativeClass>::UserData: Send,
impl<'a, T, Access> Sync for RefInstance<'a, T, Access> where
Access: Sync,
<T as NativeClass>::Base: Sync,
<T as NativeClass>::UserData: Sync,
Access: Sync,
<T as NativeClass>::Base: Sync,
<T as NativeClass>::UserData: Sync,
impl<'a, T, Access> Unpin for RefInstance<'a, T, Access> where
Access: Unpin,
<T as NativeClass>::UserData: Unpin,
Access: Unpin,
<T as NativeClass>::UserData: Unpin,
impl<'a, T, Access> UnwindSafe for RefInstance<'a, T, Access> where
Access: UnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
<T as NativeClass>::UserData: UnwindSafe,
Access: UnwindSafe,
<T as NativeClass>::Base: RefUnwindSafe,
<T as NativeClass>::UserData: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,