Trait StaticArgsMethod

Source
pub trait StaticArgsMethod<C: NativeClass>:
    Send
    + Sync
    + 'static {
    type Args: FromVarargs;

    // Required method
    fn call(&self, this: TInstance<'_, C>, args: Self::Args) -> Variant;

    // Provided method
    fn site() -> Option<Site<'static>> { ... }
}
Expand description

Trait for methods whose argument lists are known at compile time. Not to be confused with a “static method”.

Required Associated Types§

Required Methods§

Source

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

Provided Methods§

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§