[−][src]Struct litto::lang::tinylang::types::NativeProcedure
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]
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
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]
fn apply(
&self,
env: &<TinyLang as Interpreter>::Env,
args: &[<TinyLang as Interpreter>::Expr]
) -> Result<<TinyLang as Interpreter>::Value, <TinyLang as Interpreter>::Error>
[src]
&self,
env: &<TinyLang as Interpreter>::Env,
args: &[<TinyLang as Interpreter>::Expr]
) -> Result<<TinyLang as Interpreter>::Value, <TinyLang as Interpreter>::Error>
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
C: AbstractValue<TinyLang>,
D: AbstractValue<TinyLang>,
E: AbstractValue<TinyLang>,
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
C: AbstractValue<TinyLang>,
D: AbstractValue<TinyLang>,
E: AbstractValue<TinyLang>,
fn from(
value: (&'static str, fn(_: &A, _: &B, _: &C, _: &D, _: &E) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
[src]
value: (&'static str, fn(_: &A, _: &B, _: &C, _: &D, _: &E) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
C: AbstractValue<TinyLang>,
D: AbstractValue<TinyLang>,
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
C: AbstractValue<TinyLang>,
D: AbstractValue<TinyLang>,
fn from(
value: (&'static str, fn(_: &A, _: &B, _: &C, _: &D) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
[src]
value: (&'static str, fn(_: &A, _: &B, _: &C, _: &D) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
C: AbstractValue<TinyLang>,
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
C: AbstractValue<TinyLang>,
fn from(
value: (&'static str, fn(_: &A, _: &B, _: &C) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
[src]
value: (&'static str, fn(_: &A, _: &B, _: &C) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
impl<R, A, B> From<(&'static str, fn(&A, &B) -> R)> for NativeProcedure where
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
[src]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
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]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
B: AbstractValue<TinyLang>,
fn from(
value: (&'static str, fn(_: &A, _: &B) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
[src]
value: (&'static str, fn(_: &A, _: &B) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
impl<R, A> From<(&'static str, fn(&A) -> R)> for NativeProcedure where
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
[src]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
impl<R, A> From<(&'static str, fn(&A) -> Result<R, <TinyLang as Interpreter>::Error>)> for NativeProcedure where
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
[src]
R: AbstractValue<TinyLang>,
A: AbstractValue<TinyLang>,
fn from(
value: (&'static str, fn(_: &A) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
[src]
value: (&'static str, fn(_: &A) -> Result<R, <TinyLang as Interpreter>::Error>)
) -> Self
impl Trace for NativeProcedure
[src]
Auto Trait Implementations
impl !RefUnwindSafe for NativeProcedure
impl !Send for NativeProcedure
impl !Sync for NativeProcedure
impl Unpin for NativeProcedure
impl !UnwindSafe for NativeProcedure
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,