pub enum ScopeKind {
Global,
Module,
Function,
FunctionBody,
Block,
Catch,
With,
Class,
ClassField,
StaticBlock,
}Expand description
What made a scope.
Variants§
Global
A script’s top level.
Module
A module’s top level.
Function
A function, arrow or method: its parameters, and its body’s
declarations too unless it has a ScopeKind::FunctionBody.
FunctionBody
A function’s body, apart from its parameters, when a parameter has a default or a computed key: what the body declares can’t be seen from the parameters, as the spec’s separate environment has it.
Block
A block, a switch’s cases, a for with let or const in its
head, or the block Annex B puts around if (a) function f() {}.
Catch
A catch clause: its parameter and its block’s declarations.
With
The body of a with, where any name may be the object’s.
Class
A class: its own name, its heritage and its computed keys.
ClassField
The implicit function a class field’s initializer runs in.
StaticBlock
A class static { } block.
Trait Implementations§
impl Copy for ScopeKind
impl Eq for ScopeKind
impl StructuralPartialEq for ScopeKind
Auto Trait Implementations§
impl Forget for ScopeKind
impl Freeze for ScopeKind
impl Move for ScopeKind
impl RefUnwindSafe for ScopeKind
impl Send for ScopeKind
impl Sync for ScopeKind
impl Unpin for ScopeKind
impl UnsafeUnpin for ScopeKind
impl UnwindSafe for ScopeKind
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