pub struct ScannerMode { /* private fields */ }Expand description
A scanner mode that can be used to scan specific parts of the input. The contained data is used to create a scanner mode that can be used to scan the input.
Implementations§
Source§impl ScannerMode
impl ScannerMode
Sourcepub fn new<P, T>(name: &str, patterns: P, mode_transitions: T) -> Self
pub fn new<P, T>(name: &str, patterns: P, mode_transitions: T) -> Self
Creates a new scanner mode with the given name and patterns.
§Arguments
name- The name of the scanner mode.patterns- The regular expressions that are valid token types in this mode, bundled with their token type numbers.mode_transitions- The transitions between the scanner modes triggered by a token type number. It is a vector of tuples of the token type numbers and the new scanner mode index. The entries should be are sorted by token type number. The scanner mode index is the index of the scanner mode in the scanner mode vector of the scanner and is determined by the order of the insertions of scanner modes into the scanner.
§Returns
The new scanner mode.
Trait Implementations§
Source§impl Clone for ScannerMode
impl Clone for ScannerMode
Source§fn clone(&self) -> ScannerMode
fn clone(&self) -> ScannerMode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScannerMode
impl Debug for ScannerMode
Source§impl<'de> Deserialize<'de> for ScannerMode
impl<'de> Deserialize<'de> for ScannerMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ScannerMode
impl PartialEq for ScannerMode
Source§impl Serialize for ScannerMode
impl Serialize for ScannerMode
impl Eq for ScannerMode
impl StructuralPartialEq for ScannerMode
Auto Trait Implementations§
impl Freeze for ScannerMode
impl RefUnwindSafe for ScannerMode
impl Send for ScannerMode
impl Sync for ScannerMode
impl Unpin for ScannerMode
impl UnwindSafe for ScannerMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)