Skip to main content

Module

Struct Module 

Source
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

Source

pub fn new(specifier: String, source: String) -> Self

Source

pub fn add_export(&mut self, name: String, value: JSValue, mutable: bool)

Source

pub fn add_import( &mut self, module_specifier: String, import_name: String, local_name: String, )

Source

pub fn get_export(&self, name: &str) -> Option<&ModuleExport>

Source

pub fn get_export_mut(&mut self, name: &str) -> Option<&mut ModuleExport>

Source

pub fn get_export_value(&self, name: &str) -> JSValue

Source

pub fn set_export_value(&mut self, name: &str, value: JSValue)

Source

pub fn create_namespace_object(&mut self, atom_table: &mut AtomTable) -> usize

Source

pub fn get_or_create_namespace_object( &mut self, atom_table: &mut AtomTable, ) -> usize

Source

pub fn has_dependencies(&self) -> bool

Source

pub fn get_dependencies(&self) -> Vec<String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.