pub struct ScriptInfoParser<'a> { /* private fields */ }Expand description
Parser for [Script Info] section content
Parses key-value pairs from the script info section and handles
special fields like ScriptType that affect parsing behavior.
§Performance
- Time complexity: O(n) for n lines in section
- Memory: Zero allocations via lifetime-generic spans
- Target: <0.5ms for typical script info sections
Implementations§
Source§impl<'a> ScriptInfoParser<'a>
impl<'a> ScriptInfoParser<'a>
Sourcepub fn new(source: &'a str, start_position: usize, start_line: usize) -> Self
pub fn new(source: &'a str, start_position: usize, start_line: usize) -> Self
Create new script info parser for source text
§Arguments
source- Source text to parsestart_position- Starting byte position in sourcestart_line- Starting line number for error reporting
Sourcepub fn parse(self) -> ParseResult<ScriptInfoParseResult<'a>>
pub fn parse(self) -> ParseResult<ScriptInfoParseResult<'a>>
Parse script info section content
Returns the parsed section and any issues encountered during parsing.
Handles ScriptType field detection and version updating.
§Returns
Tuple of (parsed_section, detected_version, parse_issues, final_position, final_line)
§Errors
Returns an error if the script info section contains malformed key-value pairs or other unrecoverable syntax errors.
Sourcepub fn issues(self) -> Vec<ParseIssue>
pub fn issues(self) -> Vec<ParseIssue>
Get accumulated parse issues
Auto Trait Implementations§
impl<'a> Freeze for ScriptInfoParser<'a>
impl<'a> RefUnwindSafe for ScriptInfoParser<'a>
impl<'a> Send for ScriptInfoParser<'a>
impl<'a> Sync for ScriptInfoParser<'a>
impl<'a> Unpin for ScriptInfoParser<'a>
impl<'a> UnwindSafe for ScriptInfoParser<'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