pub enum ModuleImportAttributes {
Absent,
Present(Box<[ModuleImportAttribute]>),
}Expand description
Syntactic import-attribute state for one requested module.
Present([]) deliberately differs from Self::Absent so compiler and
source tooling can retain whether with {} was authored. Pinned QuickJS
does not allocate an attributes object until the first entry, however, so
both states collapse to None through Self::effective at the host
checker and loader boundary.
Variants§
Absent
No with clause was authored.
Present(Box<[ModuleImportAttribute]>)
An authored with clause, possibly empty.
Implementations§
Source§impl ModuleImportAttributes
impl ModuleImportAttributes
Sourcepub fn effective(&self) -> Option<&[ModuleImportAttribute]>
pub fn effective(&self) -> Option<&[ModuleImportAttribute]>
Attributes exposed to QuickJS-compatible host hooks.
Sourcepub fn syntactic(&self) -> Option<&[ModuleImportAttribute]>
pub fn syntactic(&self) -> Option<&[ModuleImportAttribute]>
Entries from an authored with clause, including an empty clause.
Trait Implementations§
Source§impl Clone for ModuleImportAttributes
impl Clone for ModuleImportAttributes
Source§impl Debug for ModuleImportAttributes
impl Debug for ModuleImportAttributes
impl Eq for ModuleImportAttributes
Source§impl PartialEq for ModuleImportAttributes
impl PartialEq for ModuleImportAttributes
impl StructuralPartialEq for ModuleImportAttributes
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleImportAttributes
impl !Send for ModuleImportAttributes
impl !Sync for ModuleImportAttributes
impl !UnwindSafe for ModuleImportAttributes
impl Freeze for ModuleImportAttributes
impl Unpin for ModuleImportAttributes
impl UnsafeUnpin for ModuleImportAttributes
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