pub struct ZeroScanner<'a> {
input: &'a str,
pub position: Position,
char_index: usize,
char_indices: Vec<(usize, char)>,
token_pool: TokenPool<'a>,
}Expand description
Zero-copy string scanner that operates on slices
Fields§
§input: &'a strReference to the input string
position: PositionCurrent position in the input
char_index: usizeCurrent character index
char_indices: Vec<(usize, char)>Cached character indices for faster access
token_pool: TokenPool<'a>Token pool for allocation optimization
Implementations§
Source§impl<'a> ZeroScanner<'a>
impl<'a> ZeroScanner<'a>
Sourcepub fn current_char(&self) -> Option<char>
pub fn current_char(&self) -> Option<char>
Get the current character
Sourcepub fn slice_from(&self, start_position: Position) -> Result<&'a str>
pub fn slice_from(&self, start_position: Position) -> Result<&'a str>
Get a slice of the input from start position to current position
Sourcepub fn slice_between(&self, start: Position, end: Position) -> Result<&'a str>
pub fn slice_between(&self, start: Position, end: Position) -> Result<&'a str>
Get a slice between two positions
Sourcepub fn stats(&self) -> ScannerStats
pub fn stats(&self) -> ScannerStats
Get scanner statistics for performance monitoring
Sourcepub fn scan_plain_scalar_zero_copy(&mut self) -> Result<ZeroToken<'a>>
pub fn scan_plain_scalar_zero_copy(&mut self) -> Result<ZeroToken<'a>>
Scan a plain scalar using zero-copy slicing
Sourcepub fn scan_identifier_zero_copy(&mut self) -> Result<ZeroString<'a>>
pub fn scan_identifier_zero_copy(&mut self) -> Result<ZeroString<'a>>
Scan a simple identifier using zero-copy slicing (for anchors/aliases)
Sourcepub fn skip_whitespace(&mut self)
pub fn skip_whitespace(&mut self)
Skip whitespace efficiently
Auto Trait Implementations§
impl<'a> Freeze for ZeroScanner<'a>
impl<'a> RefUnwindSafe for ZeroScanner<'a>
impl<'a> Send for ZeroScanner<'a>
impl<'a> Sync for ZeroScanner<'a>
impl<'a> Unpin for ZeroScanner<'a>
impl<'a> UnwindSafe for ZeroScanner<'a>
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