pub struct Parser<'a> { /* private fields */ }Expand description
Parser for schema files.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn new(tokens: &'a [Token], source: &'a str) -> Self
pub fn new(tokens: &'a [Token], source: &'a str) -> Self
Creates a new parser from a token slice and the original source text.
Sourcepub fn take_errors(&mut self) -> Vec<SchemaError>
pub fn take_errors(&mut self) -> Vec<SchemaError>
Returns all errors that were silently recovered from during parsing.
These are non-fatal: the parser managed to continue past them by
skipping to the next top-level declaration. Call this after
[parse_schema] to collect the full set of parse diagnostics.
Sourcepub fn parse_schema(&mut self) -> Result<Schema>
pub fn parse_schema(&mut self) -> Result<Schema>
Parses a complete schema.
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'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