pub enum LexicalDeclaration {
Const(VariableList),
Let(VariableList),
Using(VariableList),
AwaitUsing(VariableList),
}Expand description
A lexical declaration defines variables that are scoped to the lexical environment of the variable declaration.
Variants§
Const(VariableList)
A const variable creates a constant whose scope can be either global or local
to the block in which it is declared.
An initializer for a constant is required. You must specify its value in the same statement in which it’s declared. (This makes sense, given that it can’t be changed later)
Let(VariableList)
A let variable is limited to a scope of a block statement, or expression on
which it is used, unlike the var keyword, which defines a variable globally, or locally to
an entire function regardless of block scope.
Just like const, let does not create properties of the window object when declared
globally (in the top-most scope).
If a let declaration does not have an initializer, the variable is assigned the value undefined.
Using(VariableList)
A using declaration creates a block-scoped resource that is automatically
disposed when control exits the block.
AwaitUsing(VariableList)
An await using declaration creates a block-scoped resource that is automatically
disposed asynchronously when control exits the block.
Implementations§
Source§impl LexicalDeclaration
impl LexicalDeclaration
Sourcepub const fn variable_list(&self) -> &VariableList
pub const fn variable_list(&self) -> &VariableList
Gets the inner variable list of the LexicalDeclaration
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for LexicalDeclaration
impl<'arbitrary> Arbitrary<'arbitrary> for LexicalDeclaration
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for LexicalDeclaration
impl Clone for LexicalDeclaration
Source§fn clone(&self) -> LexicalDeclaration
fn clone(&self) -> LexicalDeclaration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more