pub trait State: Clone {
type TokenKind: Debug + Copy + TokenKind + Into<Self::TokenType>;
type TokenType: Debug + Copy + TokenType;
Show 16 methods
// Required methods
fn is_expr_allowed(&self) -> bool;
fn set_is_expr_allowed(&mut self, is_expr_allowed: bool);
fn set_next_regexp(&mut self, start: Option<BytePos>);
fn had_line_break(&self) -> bool;
fn mark_had_line_break(&mut self);
fn had_line_break_before_last(&self) -> bool;
fn token_contexts(&self) -> &TokenContexts;
fn mut_token_contexts(&mut self) -> &mut TokenContexts;
fn set_token_type(&mut self, token_type: Self::TokenType);
fn token_type(&self) -> Option<Self::TokenType>;
fn syntax(&self) -> SyntaxFlags;
fn prev_hi(&self) -> BytePos;
fn start(&self) -> BytePos;
// Provided methods
fn can_have_trailing_line_comment(&self) -> bool { ... }
fn can_have_trailing_comment(&self) -> bool { ... }
fn last_was_tpl_element(&self) -> bool { ... }
}
Required Associated Types§
type TokenKind: Debug + Copy + TokenKind + Into<Self::TokenType>
type TokenType: Debug + Copy + TokenType
Required Methods§
fn is_expr_allowed(&self) -> bool
fn set_is_expr_allowed(&mut self, is_expr_allowed: bool)
fn set_next_regexp(&mut self, start: Option<BytePos>)
fn had_line_break(&self) -> bool
fn mark_had_line_break(&mut self)
fn had_line_break_before_last(&self) -> bool
fn token_contexts(&self) -> &TokenContexts
fn mut_token_contexts(&mut self) -> &mut TokenContexts
fn set_token_type(&mut self, token_type: Self::TokenType)
fn token_type(&self) -> Option<Self::TokenType>
fn syntax(&self) -> SyntaxFlags
fn prev_hi(&self) -> BytePos
fn start(&self) -> BytePos
Provided Methods§
fn can_have_trailing_line_comment(&self) -> bool
fn can_have_trailing_comment(&self) -> bool
fn last_was_tpl_element(&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.