pub trait TokenFactory<'a, TokenAndSpan, I: Tokens<TokenAndSpan>>: Sized + PartialEq {
type Lexer: Lexer<'a, TokenAndSpan>;
type Buffer: Buffer<'a, I = I, Token = Self, TokenAndSpan = TokenAndSpan>;
Show 135 associated constants and 142 methods
const FROM: Self;
const FOR: Self;
const INSTANCEOF: Self;
const SATISFIES: Self;
const THROW: Self;
const AS: Self;
const NAMESPACE: Self;
const RETURN: Self;
const AT: Self;
const EXPORT: Self;
const DECLARE: Self;
const ASSERTS: Self;
const ASSERT: Self;
const JSX_TAG_END: Self;
const JSX_TAG_START: Self;
const DOLLAR_LBRACE: Self;
const BACKQUOTE: Self;
const HASH: Self;
const IN: Self;
const IS: Self;
const CONST: Self;
const DOT: Self;
const TARGET: Self;
const GET: Self;
const SET: Self;
const DOTDOTDOT: Self;
const NULLISH_ASSIGN: Self;
const NULLISH_COALESCING: Self;
const QUESTION: Self;
const COLON: Self;
const COMMA: Self;
const BIT_AND: Self;
const BIT_AND_EQ: Self;
const BIT_OR: Self;
const BIT_OR_EQ: Self;
const LOGICAL_AND: Self;
const LOGICAL_AND_EQ: Self;
const LOGICAL_OR: Self;
const LOGICAL_OR_EQ: Self;
const MUL: Self;
const MUL_EQ: Self;
const MOD: Self;
const MOD_EQ: Self;
const EXP: Self;
const EXP_EQ: Self;
const DIV: Self;
const DIV_EQ: Self;
const EQUAL: Self;
const LSHIFT: Self;
const LSHIFT_EQ: Self;
const LESS: Self;
const GLOBAL: Self;
const LESS_EQ: Self;
const RSHIFT: Self;
const RSHIFT_EQ: Self;
const GREATER: Self;
const GREATER_EQ: Self;
const ZERO_FILL_RSHIFT: Self;
const ZERO_FILL_RSHIFT_EQ: Self;
const NULL: Self;
const ANY: Self;
const BOOLEAN: Self;
const BIGINT: Self;
const NEVER: Self;
const NUMBER: Self;
const OBJECT: Self;
const STRING: Self;
const SYMBOL: Self;
const UNKNOWN: Self;
const UNDEFINED: Self;
const INTRINSIC: Self;
const TRUE: Self;
const TRY: Self;
const FALSE: Self;
const ENUM: Self;
const YIELD: Self;
const LET: Self;
const VAR: Self;
const STATIC: Self;
const IMPLEMENTS: Self;
const INTERFACE: Self;
const TYPE: Self;
const PACKAGE: Self;
const PRIVATE: Self;
const PROTECTED: Self;
const PUBLIC: Self;
const READONLY: Self;
const ARROW: Self;
const REQUIRE: Self;
const AWAIT: Self;
const BREAK: Self;
const CONTINUE: Self;
const THIS: Self;
const SUPER: Self;
const WHILE: Self;
const DO: Self;
const LPAREN: Self;
const RPAREN: Self;
const LBRACKET: Self;
const RBRACKET: Self;
const LBRACE: Self;
const FINALLY: Self;
const CATCH: Self;
const SWITCH: Self;
const RBRACE: Self;
const FUNCTION: Self;
const IF: Self;
const ELSE: Self;
const CLASS: Self;
const NEW: Self;
const ABSTRACT: Self;
const ACCESSOR: Self;
const IMPORT: Self;
const PLUS: Self;
const MINUS: Self;
const BANG: Self;
const TILDE: Self;
const PLUS_PLUS: Self;
const MINUS_MINUS: Self;
const DELETE: Self;
const TYPEOF: Self;
const VOID: Self;
const EXTENDS: Self;
const SEMI: Self;
const OF: Self;
const KEYOF: Self;
const UNIQUE: Self;
const INFER: Self;
const USING: Self;
const WITH: Self;
const ASYNC: Self;
const CASE: Self;
const DEFAULT: Self;
const DEBUGGER: Self;
const EOF: Self;
// Required methods
fn jsx_name(name: &'a str, lexer: &mut Self::Lexer) -> Self;
fn is_jsx_name(&self) -> bool;
fn take_jsx_name(self, buffer: &mut Self::Buffer) -> Atom;
fn str(value: Atom, raw: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_str(&self) -> bool;
fn is_str_raw_content(&self, content: &str, buffer: &Self::Buffer) -> bool;
fn take_str(self, buffer: &mut Self::Buffer) -> (Atom, Atom);
fn template(
cooked: LexResult<Atom>,
raw: Atom,
lexer: &mut Self::Lexer,
) -> Self;
fn is_template(&self) -> bool;
fn take_template(self, buffer: &mut Self::Buffer) -> (LexResult<Atom>, Atom);
fn jsx_text(value: Atom, raw: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_jsx_text(&self) -> bool;
fn take_jsx_text(self, buffer: &mut Self::Buffer) -> (Atom, Atom);
fn regexp(content: Atom, flags: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_regexp(&self) -> bool;
fn take_regexp(self, buffer: &mut Self::Buffer) -> (Atom, Atom);
fn num(value: f64, raw: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_num(&self) -> bool;
fn take_num(self, buffer: &mut Self::Buffer) -> (f64, Atom);
fn bigint(value: Box<BigInt>, raw: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_bigint(&self) -> bool;
fn take_bigint(self, buffer: &mut Self::Buffer) -> (Box<BigInt>, Atom);
fn shebang(value: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_shebang(&self) -> bool;
fn take_shebang(self, buffer: &mut Self::Buffer) -> Atom;
fn unknown_ident(value: Atom, lexer: &mut Self::Lexer) -> Self;
fn is_unknown_ident(&self) -> bool;
fn take_unknown_ident(self, buffer: &mut Self::Buffer) -> Atom;
fn take_unknown_ident_ref<'b>(
&'b self,
buffer: &'b Self::Buffer,
) -> &'b Atom;
fn is_known_ident(&self) -> bool;
fn take_known_ident(&self) -> Atom;
fn starts_expr(&self) -> bool;
fn to_string(&self, buffer: &Self::Buffer) -> String;
fn is_error(&self) -> bool;
fn take_error(self, buffer: &mut Self::Buffer) -> Error;
fn is_word(&self) -> bool;
fn take_word(self, buffer: &Self::Buffer) -> Option<Atom>;
fn is_keyword(&self) -> bool;
fn is_reserved(&self, ctx: Context) -> bool;
fn into_atom(self, lexer: &mut Self::Lexer) -> Option<Atom>;
fn follows_keyword_let(&self) -> bool;
fn is_bin_op(&self) -> bool;
fn as_bin_op(&self) -> Option<BinaryOp>;
fn is_assign_op(&self) -> bool;
fn as_assign_op(&self) -> Option<AssignOp>;
fn is_no_substitution_template_literal(&self) -> bool;
fn is_template_head(&self) -> bool;
// Provided methods
fn is_less(&self) -> bool { ... }
fn is_less_eq(&self) -> bool { ... }
fn is_greater(&self) -> bool { ... }
fn is_colon(&self) -> bool { ... }
fn is_comma(&self) -> bool { ... }
fn is_equal(&self) -> bool { ... }
fn is_question(&self) -> bool { ... }
fn is_null(&self) -> bool { ... }
fn is_lshift(&self) -> bool { ... }
fn is_rshift(&self) -> bool { ... }
fn is_rshift_eq(&self) -> bool { ... }
fn is_greater_eq(&self) -> bool { ... }
fn is_true(&self) -> bool { ... }
fn is_false(&self) -> bool { ... }
fn is_enum(&self) -> bool { ... }
fn is_yield(&self) -> bool { ... }
fn is_let(&self) -> bool { ... }
fn is_var(&self) -> bool { ... }
fn is_static(&self) -> bool { ... }
fn is_extends(&self) -> bool { ... }
fn is_implements(&self) -> bool { ... }
fn is_interface(&self) -> bool { ... }
fn is_type(&self) -> bool { ... }
fn is_package(&self) -> bool { ... }
fn is_private(&self) -> bool { ... }
fn is_protected(&self) -> bool { ... }
fn is_public(&self) -> bool { ... }
fn is_readonly(&self) -> bool { ... }
fn is_await(&self) -> bool { ... }
fn is_break(&self) -> bool { ... }
fn is_continue(&self) -> bool { ... }
fn is_arrow(&self) -> bool { ... }
fn is_this(&self) -> bool { ... }
fn is_super(&self) -> bool { ... }
fn is_using(&self) -> bool { ... }
fn is_backquote(&self) -> bool { ... }
fn is_lparen(&self) -> bool { ... }
fn is_rparen(&self) -> bool { ... }
fn is_lbracket(&self) -> bool { ... }
fn is_rbracket(&self) -> bool { ... }
fn is_lbrace(&self) -> bool { ... }
fn is_rbrace(&self) -> bool { ... }
fn is_function(&self) -> bool { ... }
fn is_class(&self) -> bool { ... }
fn is_if(&self) -> bool { ... }
fn is_return(&self) -> bool { ... }
fn is_switch(&self) -> bool { ... }
fn is_throw(&self) -> bool { ... }
fn is_catch(&self) -> bool { ... }
fn is_finally(&self) -> bool { ... }
fn is_try(&self) -> bool { ... }
fn is_with(&self) -> bool { ... }
fn is_while(&self) -> bool { ... }
fn is_new(&self) -> bool { ... }
fn is_ident_ref(&self, ctx: Context) -> bool { ... }
fn is_import(&self) -> bool { ... }
fn is_export(&self) -> bool { ... }
fn is_dot(&self) -> bool { ... }
fn is_do(&self) -> bool { ... }
fn is_for(&self) -> bool { ... }
fn is_from(&self) -> bool { ... }
fn is_dotdotdot(&self) -> bool { ... }
fn is_plus(&self) -> bool { ... }
fn is_minus(&self) -> bool { ... }
fn is_bang(&self) -> bool { ... }
fn is_tilde(&self) -> bool { ... }
fn is_plus_plus(&self) -> bool { ... }
fn is_minus_minus(&self) -> bool { ... }
fn is_delete(&self) -> bool { ... }
fn is_typeof(&self) -> bool { ... }
fn is_of(&self) -> bool { ... }
fn is_void(&self) -> bool { ... }
fn is_hash(&self) -> bool { ... }
fn is_in(&self) -> bool { ... }
fn is_const(&self) -> bool { ... }
fn is_star(&self) -> bool { ... }
fn is_mod(&self) -> bool { ... }
fn is_semi(&self) -> bool { ... }
fn is_slash(&self) -> bool { ... }
fn is_slash_eq(&self) -> bool { ... }
fn is_jsx_tag_start(&self) -> bool { ... }
fn is_jsx_tag_end(&self) -> bool { ... }
fn is_asserts(&self) -> bool { ... }
fn is_is(&self) -> bool { ... }
fn is_as(&self) -> bool { ... }
fn is_satisfies(&self) -> bool { ... }
fn is_instanceof(&self) -> bool { ... }
fn is_async(&self) -> bool { ... }
fn is_case(&self) -> bool { ... }
fn is_default(&self) -> bool { ... }
fn is_debugger(&self) -> bool { ... }
fn is_bit_and(&self) -> bool { ... }
fn is_bit_or(&self) -> bool { ... }
fn is_exp(&self) -> bool { ... }
fn is_eof(&self) -> bool { ... }
}
Required Associated Constants§
const FROM: Self
const FOR: Self
const INSTANCEOF: Self
const SATISFIES: Self
const THROW: Self
const AS: Self
const NAMESPACE: Self
const RETURN: Self
const AT: Self
const EXPORT: Self
const DECLARE: Self
const ASSERTS: Self
const ASSERT: Self
const JSX_TAG_END: Self
const JSX_TAG_START: Self
const DOLLAR_LBRACE: Self
const BACKQUOTE: Self
const HASH: Self
const IN: Self
const IS: Self
const CONST: Self
const DOT: Self
const TARGET: Self
const GET: Self
const SET: Self
const DOTDOTDOT: Self
const NULLISH_ASSIGN: Self
const NULLISH_COALESCING: Self
const QUESTION: Self
const COLON: Self
const COMMA: Self
const BIT_AND: Self
const BIT_AND_EQ: Self
const BIT_OR: Self
const BIT_OR_EQ: Self
const LOGICAL_AND: Self
const LOGICAL_AND_EQ: Self
const LOGICAL_OR: Self
const LOGICAL_OR_EQ: Self
const MUL: Self
const MUL_EQ: Self
const MOD: Self
const MOD_EQ: Self
const EXP: Self
const EXP_EQ: Self
const DIV: Self
const DIV_EQ: Self
const EQUAL: Self
const LSHIFT: Self
const LSHIFT_EQ: Self
const LESS: Self
const GLOBAL: Self
const LESS_EQ: Self
const RSHIFT: Self
const RSHIFT_EQ: Self
const GREATER: Self
const GREATER_EQ: Self
const ZERO_FILL_RSHIFT: Self
const ZERO_FILL_RSHIFT_EQ: Self
const NULL: Self
const ANY: Self
const BOOLEAN: Self
const BIGINT: Self
const NEVER: Self
const NUMBER: Self
const OBJECT: Self
const STRING: Self
const SYMBOL: Self
const UNKNOWN: Self
const UNDEFINED: Self
const INTRINSIC: Self
const TRUE: Self
const TRY: Self
const FALSE: Self
const ENUM: Self
const YIELD: Self
const LET: Self
const VAR: Self
const STATIC: Self
const IMPLEMENTS: Self
const INTERFACE: Self
const TYPE: Self
const PACKAGE: Self
const PRIVATE: Self
const PROTECTED: Self
const PUBLIC: Self
const READONLY: Self
const ARROW: Self
const REQUIRE: Self
const AWAIT: Self
const BREAK: Self
const CONTINUE: Self
const THIS: Self
const SUPER: Self
const WHILE: Self
const DO: Self
const LPAREN: Self
const RPAREN: Self
const LBRACKET: Self
const RBRACKET: Self
const LBRACE: Self
const FINALLY: Self
const CATCH: Self
const SWITCH: Self
const RBRACE: Self
const FUNCTION: Self
const IF: Self
const ELSE: Self
const CLASS: Self
const NEW: Self
const ABSTRACT: Self
const ACCESSOR: Self
const IMPORT: Self
const PLUS: Self
const MINUS: Self
const BANG: Self
const TILDE: Self
const PLUS_PLUS: Self
const MINUS_MINUS: Self
const DELETE: Self
const TYPEOF: Self
const VOID: Self
const EXTENDS: Self
const SEMI: Self
const OF: Self
const KEYOF: Self
const UNIQUE: Self
const INFER: Self
const USING: Self
const WITH: Self
const ASYNC: Self
const CASE: Self
const DEFAULT: Self
const DEBUGGER: Self
const EOF: Self
Required Associated Types§
type Lexer: Lexer<'a, TokenAndSpan>
type Buffer: Buffer<'a, I = I, Token = Self, TokenAndSpan = TokenAndSpan>
Required Methods§
fn jsx_name(name: &'a str, lexer: &mut Self::Lexer) -> Self
fn is_jsx_name(&self) -> bool
fn take_jsx_name(self, buffer: &mut Self::Buffer) -> Atom
fn str(value: Atom, raw: Atom, lexer: &mut Self::Lexer) -> Self
fn is_str(&self) -> bool
fn is_str_raw_content(&self, content: &str, buffer: &Self::Buffer) -> bool
fn take_str(self, buffer: &mut Self::Buffer) -> (Atom, Atom)
fn template(cooked: LexResult<Atom>, raw: Atom, lexer: &mut Self::Lexer) -> Self
fn is_template(&self) -> bool
fn take_template(self, buffer: &mut Self::Buffer) -> (LexResult<Atom>, Atom)
fn jsx_text(value: Atom, raw: Atom, lexer: &mut Self::Lexer) -> Self
fn is_jsx_text(&self) -> bool
fn take_jsx_text(self, buffer: &mut Self::Buffer) -> (Atom, Atom)
fn regexp(content: Atom, flags: Atom, lexer: &mut Self::Lexer) -> Self
fn is_regexp(&self) -> bool
fn take_regexp(self, buffer: &mut Self::Buffer) -> (Atom, Atom)
fn num(value: f64, raw: Atom, lexer: &mut Self::Lexer) -> Self
fn is_num(&self) -> bool
fn take_num(self, buffer: &mut Self::Buffer) -> (f64, Atom)
fn bigint(value: Box<BigInt>, raw: Atom, lexer: &mut Self::Lexer) -> Self
fn is_bigint(&self) -> bool
fn take_bigint(self, buffer: &mut Self::Buffer) -> (Box<BigInt>, Atom)
fn shebang(value: Atom, lexer: &mut Self::Lexer) -> Self
fn is_shebang(&self) -> bool
fn take_shebang(self, buffer: &mut Self::Buffer) -> Atom
fn unknown_ident(value: Atom, lexer: &mut Self::Lexer) -> Self
fn is_unknown_ident(&self) -> bool
fn take_unknown_ident(self, buffer: &mut Self::Buffer) -> Atom
fn take_unknown_ident_ref<'b>(&'b self, buffer: &'b Self::Buffer) -> &'b Atom
fn is_known_ident(&self) -> bool
fn take_known_ident(&self) -> Atom
fn starts_expr(&self) -> bool
fn to_string(&self, buffer: &Self::Buffer) -> String
fn is_error(&self) -> bool
fn take_error(self, buffer: &mut Self::Buffer) -> Error
fn is_word(&self) -> bool
fn take_word(self, buffer: &Self::Buffer) -> Option<Atom>
fn is_keyword(&self) -> bool
fn is_reserved(&self, ctx: Context) -> bool
fn into_atom(self, lexer: &mut Self::Lexer) -> Option<Atom>
fn follows_keyword_let(&self) -> bool
fn is_bin_op(&self) -> bool
fn as_bin_op(&self) -> Option<BinaryOp>
fn is_assign_op(&self) -> bool
fn as_assign_op(&self) -> Option<AssignOp>
fn is_no_substitution_template_literal(&self) -> bool
fn is_template_head(&self) -> bool
Provided Methods§
fn is_less(&self) -> bool
fn is_less_eq(&self) -> bool
fn is_greater(&self) -> bool
fn is_colon(&self) -> bool
fn is_comma(&self) -> bool
fn is_equal(&self) -> bool
fn is_question(&self) -> bool
fn is_null(&self) -> bool
fn is_lshift(&self) -> bool
fn is_rshift(&self) -> bool
fn is_rshift_eq(&self) -> bool
fn is_greater_eq(&self) -> bool
fn is_true(&self) -> bool
fn is_false(&self) -> bool
fn is_enum(&self) -> bool
fn is_yield(&self) -> bool
fn is_let(&self) -> bool
fn is_var(&self) -> bool
fn is_static(&self) -> bool
fn is_extends(&self) -> bool
fn is_implements(&self) -> bool
fn is_interface(&self) -> bool
fn is_type(&self) -> bool
fn is_package(&self) -> bool
fn is_private(&self) -> bool
fn is_protected(&self) -> bool
fn is_public(&self) -> bool
fn is_readonly(&self) -> bool
fn is_await(&self) -> bool
fn is_break(&self) -> bool
fn is_continue(&self) -> bool
fn is_arrow(&self) -> bool
fn is_this(&self) -> bool
fn is_super(&self) -> bool
fn is_using(&self) -> bool
fn is_backquote(&self) -> bool
fn is_lparen(&self) -> bool
fn is_rparen(&self) -> bool
fn is_lbracket(&self) -> bool
fn is_rbracket(&self) -> bool
fn is_lbrace(&self) -> bool
fn is_rbrace(&self) -> bool
fn is_function(&self) -> bool
fn is_class(&self) -> bool
fn is_if(&self) -> bool
fn is_return(&self) -> bool
fn is_switch(&self) -> bool
fn is_throw(&self) -> bool
fn is_catch(&self) -> bool
fn is_finally(&self) -> bool
fn is_try(&self) -> bool
fn is_with(&self) -> bool
fn is_while(&self) -> bool
fn is_new(&self) -> bool
fn is_ident_ref(&self, ctx: Context) -> bool
fn is_import(&self) -> bool
fn is_export(&self) -> bool
fn is_dot(&self) -> bool
fn is_do(&self) -> bool
fn is_for(&self) -> bool
fn is_from(&self) -> bool
fn is_dotdotdot(&self) -> bool
fn is_plus(&self) -> bool
fn is_minus(&self) -> bool
fn is_bang(&self) -> bool
fn is_tilde(&self) -> bool
fn is_plus_plus(&self) -> bool
fn is_minus_minus(&self) -> bool
fn is_delete(&self) -> bool
fn is_typeof(&self) -> bool
fn is_of(&self) -> bool
fn is_void(&self) -> bool
fn is_hash(&self) -> bool
fn is_in(&self) -> bool
fn is_const(&self) -> bool
fn is_star(&self) -> bool
fn is_mod(&self) -> bool
fn is_semi(&self) -> bool
fn is_slash(&self) -> bool
fn is_slash_eq(&self) -> bool
fn is_jsx_tag_start(&self) -> bool
fn is_jsx_tag_end(&self) -> bool
fn is_asserts(&self) -> bool
fn is_is(&self) -> bool
fn is_as(&self) -> bool
fn is_satisfies(&self) -> bool
fn is_instanceof(&self) -> bool
fn is_async(&self) -> bool
fn is_case(&self) -> bool
fn is_default(&self) -> bool
fn is_debugger(&self) -> bool
fn is_bit_and(&self) -> bool
fn is_bit_or(&self) -> bool
fn is_exp(&self) -> bool
fn is_eof(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.