pub enum ProgramKind {
Script {
body: Vec<Statement>,
},
Module {
body: Vec<ModuleItem>,
},
}Expand description
Whether the program is a Script or a Module. ECMA-262 treats the two
goals as distinct, with differences such as top-level await and the
availability of import/export.
Variants§
Script
A Script: top-level body is a sequence of statements.
Module
A Module: top-level body may include import/export declarations.
Fields
§
body: Vec<ModuleItem>Top-level module items.
Implementations§
Trait Implementations§
Source§impl Clone for ProgramKind
impl Clone for ProgramKind
Source§fn clone(&self) -> ProgramKind
fn clone(&self) -> ProgramKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgramKind
impl Debug for ProgramKind
Source§impl Display for ProgramKind
impl Display for ProgramKind
impl Eq for ProgramKind
Source§impl PartialEq for ProgramKind
impl PartialEq for ProgramKind
impl StructuralPartialEq for ProgramKind
Auto Trait Implementations§
impl Freeze for ProgramKind
impl RefUnwindSafe for ProgramKind
impl Send for ProgramKind
impl Sync for ProgramKind
impl Unpin for ProgramKind
impl UnsafeUnpin for ProgramKind
impl UnwindSafe for ProgramKind
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