pub struct BasicScanner { /* private fields */ }Expand description
A basic scanner implementation for YAML tokenization
Implementations§
Source§impl BasicScanner
impl BasicScanner
Sourcepub fn with_limits(input: String, limits: Limits) -> Self
pub fn with_limits(input: String, limits: Limits) -> Self
Create a new scanner with custom resource limits
Sourcepub fn new_eager(input: String) -> Self
pub fn new_eager(input: String) -> Self
Create a new scanner with eager token scanning (for compatibility)
Sourcepub fn new_eager_with_limits(input: String, limits: Limits) -> Self
pub fn new_eager_with_limits(input: String, limits: Limits) -> Self
Create a new scanner with eager token scanning and custom limits
Sourcepub fn new_with_comments(input: String) -> Self
pub fn new_with_comments(input: String) -> Self
Create a new scanner with comment preservation enabled
Sourcepub fn new_with_comments_and_limits(input: String, limits: Limits) -> Self
pub fn new_with_comments_and_limits(input: String, limits: Limits) -> Self
Create a new scanner with comments and custom limits
Sourcepub fn new_eager_with_comments(input: String) -> Self
pub fn new_eager_with_comments(input: String) -> Self
Create a new scanner with eager scanning and comment preservation
Sourcepub const fn detected_indent_style(&self) -> Option<&IndentStyle>
pub const fn detected_indent_style(&self) -> Option<&IndentStyle>
Get the detected indentation style from the document
Sourcepub const fn has_scanning_error(&self) -> bool
pub const fn has_scanning_error(&self) -> bool
Check if there was a scanning error
Sourcepub fn take_scanning_error(&mut self) -> Option<Error>
pub fn take_scanning_error(&mut self) -> Option<Error>
Get the scanning error if any
Trait Implementations§
Source§impl Debug for BasicScanner
impl Debug for BasicScanner
Source§impl ScalarScanner for BasicScanner
Implementation of ScalarScanner for BasicScanner
impl ScalarScanner for BasicScanner
Implementation of ScalarScanner for BasicScanner
Source§fn scan_plain_scalar(&mut self) -> Result<Token>
fn scan_plain_scalar(&mut self) -> Result<Token>
Scan a plain scalar (unquoted string)
Source§fn scan_quoted_string(&mut self, quote_char: char) -> Result<Token>
fn scan_quoted_string(&mut self, quote_char: char) -> Result<Token>
Scan a quoted string (single or double quotes)
Source§fn scan_number(&mut self) -> Result<Token>
fn scan_number(&mut self) -> Result<Token>
Scan a number (integer or float)
Source§fn scan_literal_block_scalar(&mut self) -> Result<Token>
fn scan_literal_block_scalar(&mut self) -> Result<Token>
Scan a literal block scalar (|)
Source§fn scan_folded_block_scalar(&mut self) -> Result<Token>
fn scan_folded_block_scalar(&mut self) -> Result<Token>
Scan a folded block scalar (>)
Source§fn scan_block_scalar_header(&mut self) -> Result<(bool, Option<usize>)>
fn scan_block_scalar_header(&mut self) -> Result<(bool, Option<usize>)>
Scan block scalar header for chomping and indentation
Source§fn current_position(&self) -> Position
fn current_position(&self) -> Position
Helper: get current position
Source§fn current_char(&self) -> Option<char>
fn current_char(&self) -> Option<char>
Helper: peek at current character
Source§fn advance_char(&mut self) -> Option<char>
fn advance_char(&mut self) -> Option<char>
Helper: advance to next character
Source§fn at_line_start(&self) -> bool
fn at_line_start(&self) -> bool
Helper: check if at line start
Source§impl Scanner for BasicScanner
impl Scanner for BasicScanner
Source§fn check_token(&self) -> bool
fn check_token(&self) -> bool
Check if there are more tokens available
Auto Trait Implementations§
impl Freeze for BasicScanner
impl RefUnwindSafe for BasicScanner
impl Send for BasicScanner
impl Sync for BasicScanner
impl Unpin for BasicScanner
impl UnwindSafe for BasicScanner
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