pub struct BasicParser {Show 13 fields
scanner: BasicScanner,
events: Vec<Event>,
event_index: usize,
state: ParserState,
state_stack: Vec<ParserState>,
position: Position,
pending_anchor: Option<String>,
pending_tag: Option<String>,
last_token_type: Option<TokenType>,
scanning_error: Option<Error>,
yaml_version: Option<(u8, u8)>,
tag_directives: Vec<(String, String)>,
tag_resolver: TagResolver,
}Expand description
Basic parser implementation that converts tokens to events
Fields§
§scanner: BasicScanner§events: Vec<Event>§event_index: usize§state: ParserState§state_stack: Vec<ParserState>§position: Position§pending_anchor: Option<String>§pending_tag: Option<String>§last_token_type: Option<TokenType>§scanning_error: Option<Error>§yaml_version: Option<(u8, u8)>§tag_directives: Vec<(String, String)>§tag_resolver: TagResolverImplementations§
Source§impl BasicParser
impl BasicParser
Sourcepub fn with_limits(input: String, limits: Limits) -> Self
pub fn with_limits(input: String, limits: Limits) -> Self
Create a new streaming parser with custom limits
Sourcepub fn new_eager(input: String) -> Self
pub fn new_eager(input: String) -> Self
Create a new parser with eager parsing (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 parser with eager parsing and custom limits
Sourcepub fn from_scanner(scanner: BasicScanner) -> Self
pub fn from_scanner(scanner: BasicScanner) -> Self
Create parser from existing scanner
Sourcefn create_implicit_document_start(&mut self, position: Position) -> Event
fn create_implicit_document_start(&mut self, position: Position) -> Event
Create implicit document start event with directives
Sourcefn validate_final_state(&self) -> Result<()>
fn validate_final_state(&self) -> Result<()>
Validate that the parser is in a valid final state
Sourcefn generate_next_event(&mut self) -> Result<()>
fn generate_next_event(&mut self) -> Result<()>
Generate the next event by processing the next token
Sourcefn process_token(&mut self, token: Token) -> Result<()>
fn process_token(&mut self, token: Token) -> Result<()>
Process a single token and generate appropriate events
Sourcefn handle_node_completion(&mut self)
fn handle_node_completion(&mut self)
Handle completion of a node (scalar or collection) and manage mapping state transitions
Source§impl BasicParser
impl BasicParser
Sourcepub fn take_scanning_error(&mut self) -> Option<Error>
pub fn take_scanning_error(&mut self) -> Option<Error>
Check if there was a scanning error
Trait Implementations§
Source§impl Debug for BasicParser
impl Debug for BasicParser
Source§impl Default for BasicParser
impl Default for BasicParser
Source§impl Parser for BasicParser
impl Parser for BasicParser
Source§fn check_event(&self) -> bool
fn check_event(&self) -> bool
Check if there are more events available
Auto Trait Implementations§
impl Freeze for BasicParser
impl !RefUnwindSafe for BasicParser
impl Send for BasicParser
impl Sync for BasicParser
impl Unpin for BasicParser
impl !UnwindSafe for BasicParser
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