pub struct PartialProgram {
pub items: Vec<Item>,
pub doc_comment: Option<DocComment>,
pub errors: Vec<ParseError>,
}Expand description
A partially parsed program — always produced, never fails.
Fields§
§items: Vec<Item>Successfully parsed top-level items.
doc_comment: Option<DocComment>Module-level doc comment declared at the start of the file.
errors: Vec<ParseError>Parse issues collected during resilient parsing.
Implementations§
Source§impl PartialProgram
impl PartialProgram
Sourcepub fn into_program(self) -> Program
pub fn into_program(self) -> Program
Convert to a standard Program (dropping parse issue info).
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether the parse was completely successful (no issues).
Sourcepub fn has_only_grammar_failures(&self) -> bool
pub fn has_only_grammar_failures(&self) -> bool
True when every recorded issue is a grammar-level failure.
Trait Implementations§
Source§impl Clone for PartialProgram
impl Clone for PartialProgram
Source§fn clone(&self) -> PartialProgram
fn clone(&self) -> PartialProgram
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 Freeze for PartialProgram
impl RefUnwindSafe for PartialProgram
impl Send for PartialProgram
impl Sync for PartialProgram
impl Unpin for PartialProgram
impl UnsafeUnpin for PartialProgram
impl UnwindSafe for PartialProgram
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