Trait FunctionPointer

Source
pub trait FunctionPointer:
    Primitive
    + Copy
    + Sized {
    type Args: Tuple;
    type Return;

    // Required method
    fn call(self, args: Self::Args) -> Self::Return;
}

Required Associated Types§

Required Methods§

Source

fn call(self, args: Self::Args) -> Self::Return

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.

Implementations on Foreign Types§

Source§

impl<A1, R> FunctionPointer for fn(A1₁, A1₂, …, A1ₙ) -> R

This trait is implemented for function pointers with up to 12 arguments.

Source§

type Args = (A1,)

Source§

type Return = R

Source§

fn call(self, args: Self::Args) -> Self::Return

Source§

impl<R> FunctionPointer for fn() -> R

Source§

type Args = ()

Source§

type Return = R

Source§

fn call(self, _args: Self::Args) -> Self::Return

Implementors§