[−][src]Struct dyon::Module
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]
&mut self,
name: Arc<String>,
f: fn(_: &mut Runtime) -> T,
prelude_function: Dfn
) where
fn(_: &mut Runtime) -> T: Into<FnExt>,
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]
&mut self,
name: &str,
f: fn(_: &mut Runtime) -> T,
prelude_function: Dfn
) where
fn(_: &mut Runtime) -> T: Into<FnExt>,
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]
&mut self,
name: Arc<String>,
f: fn(_: &Variable, _: &Variable) -> Result<Variable, String>,
prelude_function: Dfn
)
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]
&mut self,
name: Arc<String>,
f: fn(_: &Variable) -> Result<Variable, String>,
prelude_function: Dfn
)
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]
&mut self,
name: &str,
f: fn(_: &Variable) -> Result<Variable, String>,
prelude_function: Dfn
)
Adds a new external prelude unary operator.
Trait Implementations
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]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,