pub enum Keyword {
Show 54 variants
Await,
Break,
Case,
Catch,
Class,
Const,
Continue,
Debugger,
Default,
Delete,
Do,
Else,
Enum,
Export,
Extends,
False,
Finally,
For,
Function,
If,
Import,
In,
Instanceof,
New,
Null,
Return,
Super,
Switch,
This,
Throw,
True,
Try,
Typeof,
Var,
Void,
While,
With,
Yield,
Let,
Static,
Implements,
Interface,
Package,
Private,
Protected,
Public,
As,
Async,
From,
Get,
Meta,
Of,
Set,
Target,
}Expand description
The words a parser treats specially: every ReservedWord, the ones
strict code reserves, and the contextual ones (async, of,
get and the rest), which are identifiers wherever they aren’t
keywords. Which a word is, where, is the parser’s to decide;
Keyword::is_reserved says which are ReservedWords.
Variants§
Await
Break
Case
Catch
Class
Const
Continue
Debugger
Default
Delete
Do
Else
Enum
Export
Extends
False
Finally
For
Function
If
Import
In
Instanceof
New
Null
Return
Super
Switch
This
Throw
True
Try
Typeof
Var
Void
While
With
Yield
Let
Static
Implements
Interface
Package
Private
Protected
Public
As
Async
From
Get
Meta
Of
Set
Target
Implementations§
Source§impl Keyword
impl Keyword
Sourcepub const fn is_reserved(self) -> bool
pub const fn is_reserved(self) -> bool
Whether it’s one of the spec’s ReservedWords. await and yield
are among them, though each is an identifier in some places.
Sourcepub const fn is_strict_reserved(self) -> bool
pub const fn is_strict_reserved(self) -> bool
Whether strict code reserves it beyond the ReservedWords.
Trait Implementations§
impl Copy for Keyword
impl Eq for Keyword
impl StructuralPartialEq for Keyword
Auto Trait Implementations§
impl Forget for Keyword
impl Freeze for Keyword
impl Move for Keyword
impl RefUnwindSafe for Keyword
impl Send for Keyword
impl Sync for Keyword
impl Unpin for Keyword
impl UnsafeUnpin for Keyword
impl UnwindSafe for Keyword
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