[][src]Struct dyon::Module

pub struct Module { /* fields omitted */ }

Stores functions for a Dyon module.

Implementations

impl Module[src]

pub fn empty() -> Module[src]

Creates a new empty module.

pub fn import_ext_prelude(&mut self, other: &Module)[src]

Import external prelude from other module.

pub fn import(&mut self, other: &Module)[src]

Import external prelude and loaded functions from module.

pub fn new() -> Module[src]

Creates a new module with standard library.

pub fn ns(&mut self, ns: &str)[src]

Sets namespace for following added functions.

pub fn no_ns(&mut self)[src]

Sets no namespace.

pub fn find_function(&self, name: &Arc<String>, relative: usize) -> FnIndex[src]

Find function relative another function index.

pub fn add<T>(
    &mut self,
    name: Arc<String>,
    f: fn(_: &mut Runtime) -> T,
    prelude_function: Dfn
) where
    fn(_: &mut Runtime) -> T: Into<FnExt>, 
[src]

Adds a new external prelude function.

pub fn add_str<T>(
    &mut self,
    name: &str,
    f: fn(_: &mut Runtime) -> T,
    prelude_function: Dfn
) where
    fn(_: &mut Runtime) -> T: Into<FnExt>, 
[src]

Adds a new external prelude function.

pub fn add_binop(
    &mut self,
    name: Arc<String>,
    f: fn(_: &Variable, _: &Variable) -> Result<Variable, String>,
    prelude_function: Dfn
)
[src]

Adds a new external prelude binary operator.

pub fn add_unop(
    &mut self,
    name: Arc<String>,
    f: fn(_: &Variable) -> Result<Variable, String>,
    prelude_function: Dfn
)
[src]

Adds a new external prelude unary operator.

pub fn add_unop_str(
    &mut self,
    name: &str,
    f: fn(_: &Variable) -> Result<Variable, String>,
    prelude_function: Dfn
)
[src]

Adds a new external prelude unary operator.

Trait Implementations

impl Clone for Module[src]

impl Default for Module[src]

Auto Trait Implementations

impl !RefUnwindSafe for Module

impl Send for Module

impl Sync for Module

impl Unpin for Module

impl !UnwindSafe for Module

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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