Trait gdnative_core::object::AsArg[][src]

pub trait AsArg<T>: Sealed { }

Trait for safe conversion from Godot object references into API method arguments. This is a sealed trait with no public interface.

In order to enforce thread safety statically, the ability to be passed to the engine is only given to some reference types. Specifically, they are:

  • All owned Ref<T, Unique> references. The Unique access is lost if passed into a method.
  • Owned and borrowed Shared references, including temporary ones (TRef).

It's unsound to pass ThreadLocal references to the engine because there is no guarantee that the reference will stay on the same thread.

To explicitly pass a null reference to the engine, use Null::null or GodotObject::null.

Implementors

impl<'a, T, U> AsArg<U> for &'a Ref<T, Shared> where
    T: GodotObject + SubClass<U>,
    U: GodotObject
[src]

impl<'a, T, U> AsArg<U> for TRef<'a, T, Shared> where
    T: GodotObject + SubClass<U>,
    U: GodotObject
[src]

impl<'a, T: GodotObject> AsArg<T> for Null<T>[src]

impl<T, U> AsArg<U> for Ref<T, Shared> where
    T: GodotObject + SubClass<U>,
    U: GodotObject
[src]

impl<T, U> AsArg<U> for Ref<T, Unique> where
    T: GodotObject + SubClass<U>,
    U: GodotObject
[src]

Loading content...