pub struct AstBuilder { /* private fields */ }Available on crate feature
alloc only.Expand description
ProgramVisitor that builds an owned Program and collects Diagnostics.
Used by parse; typically not constructed by users.
Implementations§
Source§impl AstBuilder
impl AstBuilder
Sourcepub fn finish(self) -> Result<Program, Diagnostics>
pub fn finish(self) -> Result<Program, Diagnostics>
Returns the built Program, or Err with the collected Diagnostics if any diagnostic was emitted.
Trait Implementations§
Source§impl Debug for AstBuilder
impl Debug for AstBuilder
Source§impl Default for AstBuilder
impl Default for AstBuilder
Source§impl HasDiagnostics for AstBuilder
impl HasDiagnostics for AstBuilder
Source§fn diagnostics(&mut self) -> &mut dyn Diagnostics
fn diagnostics(&mut self) -> &mut dyn Diagnostics
Returns a mutable reference to the diagnostics sink used for this parse.
Source§impl ProgramVisitor for AstBuilder
impl ProgramVisitor for AstBuilder
Source§fn start_block(&mut self) -> ControlFlow<impl BlockVisitor + '_>
fn start_block(&mut self) -> ControlFlow<impl BlockVisitor + '_>
Called at the start of each block (line). Return a
BlockVisitor to
handle this block, or break to pause parsing.Auto Trait Implementations§
impl Freeze for AstBuilder
impl RefUnwindSafe for AstBuilder
impl Send for AstBuilder
impl Sync for AstBuilder
impl Unpin for AstBuilder
impl UnsafeUnpin for AstBuilder
impl UnwindSafe for AstBuilder
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