[][src]Trait rustpython_vm::function::IntoPyNativeFunc

pub trait IntoPyNativeFunc<T, R, VM> {
    fn into_func(self) -> PyNativeFunc;
}

Implemented by types that are or can generate built-in functions.

For example, any function that:

will generate a PyNativeFunc that performs the appropriate type and arity checking, any requested conversions, and then if successful call the function with the bound values.

A bare PyNativeFunc also implements this trait, allowing the above to be done manually, for rare situations that don't fit into this model.

Required methods

fn into_func(self) -> PyNativeFunc

Loading content...

Implementors

impl<F> IntoPyNativeFunc<PyFuncArgs, Result<Rc<PyObject<dyn PyObjectPayload + 'static>>, PyRef<PyBaseException>>, VirtualMachine> for F where
    F: Fn(&VirtualMachine, PyFuncArgs) -> PyResult + 'static, 
[src]

impl<F, A, B, C, D, E, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>, OwnedParam<E>), R, ()> for F where
    F: Fn(A, B, C, D, E) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    E: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, C, D, E, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>, OwnedParam<E>), R, VirtualMachine> for F where
    F: Fn(A, B, C, D, E, &VirtualMachine) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    E: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, C, D, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>), R, ()> for F where
    F: Fn(A, B, C, D) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, C, D, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>), R, VirtualMachine> for F where
    F: Fn(A, B, C, D, &VirtualMachine) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, C, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>, OwnedParam<C>), R, ()> for F where
    F: Fn(A, B, C) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, C, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>, OwnedParam<C>), R, VirtualMachine> for F where
    F: Fn(A, B, C, &VirtualMachine) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>), R, ()> for F where
    F: Fn(A, B) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, B, R> IntoPyNativeFunc<(OwnedParam<A>, OwnedParam<B>), R, VirtualMachine> for F where
    F: Fn(A, B, &VirtualMachine) -> R + 'static,
    A: FromArgs,
    B: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, R> IntoPyNativeFunc<(OwnedParam<A>,), R, ()> for F where
    F: Fn(A) -> R + 'static,
    A: FromArgs,
    R: IntoPyObject
[src]

impl<F, A, R> IntoPyNativeFunc<(OwnedParam<A>,), R, VirtualMachine> for F where
    F: Fn(A, &VirtualMachine) -> R + 'static,
    A: FromArgs,
    R: IntoPyObject
[src]

impl<F, R> IntoPyNativeFunc<(), R, ()> for F where
    F: Fn() -> R + 'static,
    R: IntoPyObject
[src]

impl<F, R> IntoPyNativeFunc<(), R, VirtualMachine> for F where
    F: Fn(&VirtualMachine) -> R + 'static,
    R: IntoPyObject
[src]

impl<F, S, A, B, C, D, E, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>, OwnedParam<E>), R, ()> for F where
    F: Fn(&S, A, B, C, D, E) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    E: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, C, D, E, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>, OwnedParam<E>), R, VirtualMachine> for F where
    F: Fn(&S, A, B, C, D, E, &VirtualMachine) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    E: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, C, D, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>), R, ()> for F where
    F: Fn(&S, A, B, C, D) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, C, D, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>, OwnedParam<C>, OwnedParam<D>), R, VirtualMachine> for F where
    F: Fn(&S, A, B, C, D, &VirtualMachine) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    D: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, C, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>, OwnedParam<C>), R, ()> for F where
    F: Fn(&S, A, B, C) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, C, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>, OwnedParam<C>), R, VirtualMachine> for F where
    F: Fn(&S, A, B, C, &VirtualMachine) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    C: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>), R, ()> for F where
    F: Fn(&S, A, B) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, B, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>, OwnedParam<B>), R, VirtualMachine> for F where
    F: Fn(&S, A, B, &VirtualMachine) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    B: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>), R, ()> for F where
    F: Fn(&S, A) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, A, R> IntoPyNativeFunc<(RefParam<S>, OwnedParam<A>), R, VirtualMachine> for F where
    F: Fn(&S, A, &VirtualMachine) -> R + 'static,
    S: PyValue,
    A: FromArgs,
    R: IntoPyObject
[src]

impl<F, S, R> IntoPyNativeFunc<(RefParam<S>,), R, ()> for F where
    F: Fn(&S) -> R + 'static,
    S: PyValue,
    R: IntoPyObject
[src]

impl<F, S, R> IntoPyNativeFunc<(RefParam<S>,), R, VirtualMachine> for F where
    F: Fn(&S, &VirtualMachine) -> R + 'static,
    S: PyValue,
    R: IntoPyObject
[src]

Loading content...