Struct ketos::module::ModuleCode
[−]
[src]
pub struct ModuleCode { pub code: Vec<Rc<Code>>, pub exports: NameSetSlice, pub imports: Vec<ImportSet>, pub constants: Vec<(Name, Value)>, pub macros: Vec<(Name, Rc<Code>)>, pub values: Vec<(Name, Value)>, pub module_doc: Option<String>, pub docs: Vec<(Name, String)>, }
Contains code and data representing a compiled module
Fields
code: Vec<Rc<Code>>
Decoded Code
objects
exports: NameSetSlice
Exported names
imports: Vec<ImportSet>
Imported names
constants: Vec<(Name, Value)>
Decoded constant values
macros: Vec<(Name, Rc<Code>)>
Decoded macro objects
values: Vec<(Name, Value)>
Global values generated at compile time
module_doc: Option<String>
Module doc strings
docs: Vec<(Name, String)>
Doc strings
Methods
impl ModuleCode
[src]
fn new(code: Vec<Rc<Code>>, scope: &Scope) -> ModuleCode
Creates a ModuleCode
from a series of code objects and a Scope
.
Trivial code objects will be removed.
fn load_in_context(self, ctx: &Context) -> Result<(), Error>
Loads contained values into the given scope, which should be empty, and sequentially executes all contained code objects within the scope.
Trait Implementations
impl Clone for ModuleCode
[src]
fn clone(&self) -> ModuleCode
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Default for ModuleCode
[src]
fn default() -> ModuleCode
Returns the "default value" for a type. Read more