Trait gdnative::export::Method

pub trait Method<C>:
    Send
    + Sync
    + 'static
where C: NativeClass,
{ // Required method fn call(&self, this: TInstance<'_, C>, args: Varargs<'_>) -> Variant; // Provided method fn site() -> Option<Site<'static>> { ... } }
Expand description

Safe low-level trait for stateful, variadic methods that can be called on a native script type.

Required Methods§

fn call(&self, this: TInstance<'_, C>, args: Varargs<'_>) -> Variant

Calls the method on this with args.

Provided Methods§

fn site() -> Option<Site<'static>>

Returns an optional site where this method is defined. Used for logging errors in FFI wrappers.

Default implementation returns None.

Object Safety§

This trait is not object safe.

Implementors§

§

impl<C, F> Method<C> for Async<F>
where C: NativeClass, F: AsyncMethod<C>,

§

impl<C, F> Method<C> for StaticArgs<F>
where C: NativeClass, F: StaticArgsMethod<C>,