pub struct AssTokenizer<'a> { /* private fields */ }
Expand description
Incremental tokenizer for ASS scripts with zero-copy design
Maintains lexical state for streaming tokenization. Uses &'a str
spans
to avoid allocations, with optional SIMD acceleration for hot paths.
Implementations§
Source§impl<'a> AssTokenizer<'a>
impl<'a> AssTokenizer<'a>
Sourcepub fn new(source: &'a str) -> Self
pub fn new(source: &'a str) -> Self
Create new tokenizer for source text
Handles BOM detection and UTF-8 validation upfront.
Sourcepub fn next_token(&mut self) -> Result<Option<Token<'a>>>
pub fn next_token(&mut self) -> Result<Option<Token<'a>>>
Get next token from input stream
Returns None
when end of input reached. Maintains zero-copy
semantics by returning spans into source text.
§Errors
Returns an error if tokenization fails due to invalid input or scanner errors.
Sourcepub fn tokenize_all(&mut self) -> Result<Vec<Token<'a>>>
pub fn tokenize_all(&mut self) -> Result<Vec<Token<'a>>>
Get all tokens as vector for batch processing
§Errors
Returns an error if tokenization fails for any token in the input.
Sourcepub fn issues(&self) -> &[TokenIssue<'a>]
pub fn issues(&self) -> &[TokenIssue<'a>]
Get accumulated tokenization issues
Trait Implementations§
Source§impl<'a> Clone for AssTokenizer<'a>
impl<'a> Clone for AssTokenizer<'a>
Source§fn clone(&self) -> AssTokenizer<'a>
fn clone(&self) -> AssTokenizer<'a>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<'a> Freeze for AssTokenizer<'a>
impl<'a> RefUnwindSafe for AssTokenizer<'a>
impl<'a> Send for AssTokenizer<'a>
impl<'a> Sync for AssTokenizer<'a>
impl<'a> Unpin for AssTokenizer<'a>
impl<'a> UnwindSafe for AssTokenizer<'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