Trait mica::ForeignFunction

source ·
pub trait ForeignFunction<V> {
    type ParameterCount;

    const PARAMETER_COUNT: Self::ParameterCount;

    fn into_raw_foreign_function(self) -> RawForeignFunction;
}
Expand description

A Rust function that can be called from Mica.

To spare you the time needed to decipher the absolutely unreadable autogenerated implementations of this trait, functions with the following signatures are supported:

The generic parameter V is not used inside the trait. Its only purpose is to allow for multiple overlapping implementations of a trait for the same type. See ffvariants for more information.

Required Associated Types§

The type used for parameter counts in this kind of foreign functions.

This is either FunctionParameterCount or MethodParameterCount, depending on whether a function is usable as a bare function or a method.

Required Associated Constants§

The number of parameters this function has, or None if the function accepts a variable number of arguments.

The default implementation returns None.

Required Methods§

Converts the function to a RawForeignFunction.

Implementors§