pub struct Diagnostics { /* private fields */ }Expand description
Interior-mutable sink the single-pass parser pushes into while building.
Cloning shares the same backing store (it is an Rc), so it threads through
the block dispatcher (on BlockContext) as an owned value — sidestepping any
&self borrow that would clash with the &mut GreenNodeBuilder held during
emission. The handful of clones per parse are cheap pointer bumps.
Implementations§
Source§impl Diagnostics
impl Diagnostics
pub fn new() -> Self
Sourcepub fn push(&self, error: SyntaxError)
pub fn push(&self, error: SyntaxError)
Record a syntax error.
Sourcepub fn take(&self) -> Vec<SyntaxError>
pub fn take(&self) -> Vec<SyntaxError>
Drain the recorded errors. Called once after the parse completes.
Trait Implementations§
Source§impl Clone for Diagnostics
impl Clone for Diagnostics
Source§fn clone(&self) -> Diagnostics
fn clone(&self) -> Diagnostics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Diagnostics
impl Debug for Diagnostics
Source§impl Default for Diagnostics
impl Default for Diagnostics
Source§fn default() -> Diagnostics
fn default() -> Diagnostics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Diagnostics
impl !Send for Diagnostics
impl !Sync for Diagnostics
impl !UnwindSafe for Diagnostics
impl Freeze for Diagnostics
impl Unpin for Diagnostics
impl UnsafeUnpin for Diagnostics
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