[][src]Struct litto::lang::tinylang::types::NativeProcedure

pub struct NativeProcedure { /* fields omitted */ }

A native function.

Methods

impl NativeProcedure[src]

pub fn new(
    name: &'static str,
    func: impl Fn(&<TinyLang as Interpreter>::Env, &[<TinyLang as Interpreter>::Expr]) -> Result<<TinyLang as Interpreter>::Value, <TinyLang as Interpreter>::Error> + 'static
) -> Self
[src]

Create a NativeProcedure.

pub fn register(self, env: &<TinyLang as Interpreter>::Env)[src]

Register the function to an environment.

Trait Implementations

impl AbstractValue<TinyLang> for NativeProcedure[src]

impl Debug for NativeProcedure[src]

impl Display for NativeProcedure[src]

impl<R, A, B, C, D, E> From<(&'static str, fn(&A, &B, &C, &D, &E) -> R)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>,
    C: AbstractValue<TinyLang>,
    D: AbstractValue<TinyLang>,
    E: AbstractValue<TinyLang>, 
[src]

impl<R, A, B, C, D, E> From<(&'static str, fn(&A, &B, &C, &D, &E) -> Result<R, <TinyLang as Interpreter>::Error>)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>,
    C: AbstractValue<TinyLang>,
    D: AbstractValue<TinyLang>,
    E: AbstractValue<TinyLang>, 
[src]

impl<R, A, B, C, D> From<(&'static str, fn(&A, &B, &C, &D) -> R)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>,
    C: AbstractValue<TinyLang>,
    D: AbstractValue<TinyLang>, 
[src]

impl<R, A, B, C, D> From<(&'static str, fn(&A, &B, &C, &D) -> Result<R, <TinyLang as Interpreter>::Error>)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>,
    C: AbstractValue<TinyLang>,
    D: AbstractValue<TinyLang>, 
[src]

impl<R, A, B, C> From<(&'static str, fn(&A, &B, &C) -> R)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>,
    C: AbstractValue<TinyLang>, 
[src]

impl<R, A, B, C> From<(&'static str, fn(&A, &B, &C) -> Result<R, <TinyLang as Interpreter>::Error>)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>,
    C: AbstractValue<TinyLang>, 
[src]

impl<R, A, B> From<(&'static str, fn(&A, &B) -> R)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>, 
[src]

impl<R, A, B> From<(&'static str, fn(&A, &B) -> Result<R, <TinyLang as Interpreter>::Error>)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>,
    B: AbstractValue<TinyLang>, 
[src]

impl<R, A> From<(&'static str, fn(&A) -> R)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>, 
[src]

impl<R, A> From<(&'static str, fn(&A) -> Result<R, <TinyLang as Interpreter>::Error>)> for NativeProcedure where
    R: AbstractValue<TinyLang>,
    A: AbstractValue<TinyLang>, 
[src]

impl Trace for NativeProcedure[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.