pub struct Code { /* private fields */ }
Implementations§
Source§impl Code
impl Code
pub fn name(&self) -> &RcStr
pub fn params(&self) -> &Vec<Variable>
pub fn varspec(&self) -> &VarSpec
pub fn marks(&self) -> &Vec<Mark>
pub fn doc(&self) -> &Option<RcStr>
pub fn docmap(&self) -> &HashMap<RcStr, RcStr>
Sourcepub fn apply_for_function(
&self,
globals: &mut Globals,
bindings: Vec<Rc<RefCell<Value>>>,
args: Vec<Value>,
) -> Result<Value, Error>
pub fn apply_for_function( &self, globals: &mut Globals, bindings: Vec<Rc<RefCell<Value>>>, args: Vec<Value>, ) -> Result<Value, Error>
For function calls runs this code object with the given bindings and arguments
Sourcepub fn apply_for_module(
&self,
globals: &mut Globals,
map: &HashMap<RcStr, Value>,
) -> Result<Rc<Module>, Error>
pub fn apply_for_module( &self, globals: &mut Globals, map: &HashMap<RcStr, Value>, ) -> Result<Rc<Module>, Error>
For modules runs this code object with the given map of builtins
Sourcepub fn apply_for_repl(&self, globals: &mut Globals) -> Result<Value, Error>
pub fn apply_for_repl(&self, globals: &mut Globals) -> Result<Value, Error>
For repl runs this code object while using the given map essentially as a dynamic module scope
pub fn disasm(&self) -> Result<String, Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Code
impl !RefUnwindSafe for Code
impl !Send for Code
impl !Sync for Code
impl Unpin for Code
impl !UnwindSafe for Code
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.