Trait magnus::method::Method

source ·
pub trait Method: Method { }
Expand description

Trait implemented for function pointers that can be registed as Ruby methods.

While it is possible to directly write functions that will automatically implement this trait it is not recommended, as those functions will not have the type conversions or error handling usually provided by this library. See the method and function macros for converting functions to an implementor of this trait.

This trait is implemented for the following function signatures:

AritySignature
-2unsafe extern "C" fn(Value, RArray) -> Value;
-1unsafe extern "C" fn(c_int, *const Value, Value) -> Value;
0unsafe extern "C" fn(Value) -> Value;
1unsafe extern "C" fn(Value, Value) -> Value;
2unsafe extern "C" fn(Value, Value, Value) -> Value;
16

note: for arity 0..=16 the number of arguments is 1 greater than the arity, due to the initial self argument.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Method for T
where T: Method,