pub struct Module {
pub specifier: String,
pub state: ModuleState,
pub exports: FxHashMap<String, ModuleExport>,
pub imports: Vec<ModuleImport>,
pub namespace_object: Option<usize>,
pub source: String,
pub import_meta_object: Option<usize>,
pub error: Option<String>,
}Fields§
§specifier: String§state: ModuleState§exports: FxHashMap<String, ModuleExport>§imports: Vec<ModuleImport>§namespace_object: Option<usize>§source: String§import_meta_object: Option<usize>§error: Option<String>Implementations§
Source§impl Module
impl Module
pub fn new(specifier: String, source: String) -> Self
pub fn add_export(&mut self, name: String, value: JSValue, mutable: bool)
pub fn add_import( &mut self, module_specifier: String, import_name: String, local_name: String, )
pub fn get_export(&self, name: &str) -> Option<&ModuleExport>
pub fn get_export_mut(&mut self, name: &str) -> Option<&mut ModuleExport>
pub fn get_export_value(&self, name: &str) -> JSValue
pub fn set_export_value(&mut self, name: &str, value: JSValue)
pub fn create_namespace_object(&mut self, atom_table: &mut AtomTable) -> usize
pub fn get_or_create_namespace_object( &mut self, atom_table: &mut AtomTable, ) -> usize
pub fn has_dependencies(&self) -> bool
pub fn get_dependencies(&self) -> Vec<String>
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl UnwindSafe for Module
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