Skip to main content

IntoNativeFn

Trait IntoNativeFn 

Source
pub trait IntoNativeFn<Args> {
    // Required method
    fn into_native(self) -> NativeFn;
}
Expand description

Wraps a typed Rust function into a NativeFn with automatic arity checking and argument extraction. Implemented by macro for 0–10 arguments.

Required Methods§

Implementors§

Source§

impl<F, R> IntoNativeFn<()> for F
where F: Fn(&mut Evaluator) -> R + Send + Sync + 'static, R: IntoValue,

Source§

impl<F, R, A1> IntoNativeFn<(Fallible<(A1,)>,)> for F
where F: Fn(&mut Evaluator, A1) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue,

Source§

impl<F, R, A1> IntoNativeFn<(Spanned<(A1,)>,)> for F
where F: Fn(&mut Evaluator, A1, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue,

Source§

impl<F, R, A1> IntoNativeFn<(A1,)> for F
where F: Fn(&mut Evaluator, A1) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue,

Source§

impl<F, R, A1, A2> IntoNativeFn<(Fallible<(A1, A2)>,)> for F
where F: Fn(&mut Evaluator, A1, A2) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue,

Source§

impl<F, R, A1, A2> IntoNativeFn<(Spanned<(A1, A2)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue,

Source§

impl<F, R, A1, A2> IntoNativeFn<(A1, A2)> for F
where F: Fn(&mut Evaluator, A1, A2) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue,

Source§

impl<F, R, A1, A2, A3> IntoNativeFn<(Fallible<(A1, A2, A3)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue,

Source§

impl<F, R, A1, A2, A3> IntoNativeFn<(Spanned<(A1, A2, A3)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue,

Source§

impl<F, R, A1, A2, A3> IntoNativeFn<(A1, A2, A3)> for F
where F: Fn(&mut Evaluator, A1, A2, A3) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue,

Source§

impl<F, R, A1, A2, A3, A4> IntoNativeFn<(Fallible<(A1, A2, A3, A4)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue,

Source§

impl<F, R, A1, A2, A3, A4> IntoNativeFn<(Spanned<(A1, A2, A3, A4)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue,

Source§

impl<F, R, A1, A2, A3, A4> IntoNativeFn<(A1, A2, A3, A4)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5> IntoNativeFn<(Fallible<(A1, A2, A3, A4, A5)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5> IntoNativeFn<(Spanned<(A1, A2, A3, A4, A5)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5> IntoNativeFn<(A1, A2, A3, A4, A5)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6> IntoNativeFn<(Fallible<(A1, A2, A3, A4, A5, A6)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6> IntoNativeFn<(Spanned<(A1, A2, A3, A4, A5, A6)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6> IntoNativeFn<(A1, A2, A3, A4, A5, A6)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7> IntoNativeFn<(Fallible<(A1, A2, A3, A4, A5, A6, A7)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7> IntoNativeFn<(Spanned<(A1, A2, A3, A4, A5, A6, A7)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7> IntoNativeFn<(A1, A2, A3, A4, A5, A6, A7)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8> IntoNativeFn<(Fallible<(A1, A2, A3, A4, A5, A6, A7, A8)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8> IntoNativeFn<(Spanned<(A1, A2, A3, A4, A5, A6, A7, A8)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8> IntoNativeFn<(A1, A2, A3, A4, A5, A6, A7, A8)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> IntoNativeFn<(Fallible<(A1, A2, A3, A4, A5, A6, A7, A8, A9)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue, A9: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> IntoNativeFn<(Spanned<(A1, A2, A3, A4, A5, A6, A7, A8, A9)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, A9, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue, A9: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8, A9> IntoNativeFn<(A1, A2, A3, A4, A5, A6, A7, A8, A9)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, A9) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue, A9: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> IntoNativeFn<(Fallible<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue, A9: FromValue, A10: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> IntoNativeFn<(Spanned<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>,)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, Span) -> Result<R, Error> + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue, A9: FromValue, A10: FromValue,

Source§

impl<F, R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> IntoNativeFn<(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> for F
where F: Fn(&mut Evaluator, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) -> R + Send + Sync + 'static, R: IntoValue, A1: FromValue, A2: FromValue, A3: FromValue, A4: FromValue, A5: FromValue, A6: FromValue, A7: FromValue, A8: FromValue, A9: FromValue, A10: FromValue,