pub struct EnvBuilder { /* private fields */ }Expand description
A builder that accumulates declarations and checks them together.
Useful for constructing a consistent environment from a sequence of declarations, with error recovery.
Implementations§
Source§impl EnvBuilder
impl EnvBuilder
Sourcepub fn add(&mut self, decl: Declaration) -> bool
pub fn add(&mut self, decl: Declaration) -> bool
Add a declaration to the builder, checking it against the current environment.
Sourcepub fn add_all(&mut self, decls: Vec<Declaration>) -> usize
pub fn add_all(&mut self, decls: Vec<Declaration>) -> usize
Add multiple declarations.
Sourcepub fn build(self) -> (Environment, CheckStats, Vec<(String, String)>)
pub fn build(self) -> (Environment, CheckStats, Vec<(String, String)>)
Return the built environment (consuming the builder).
Sourcepub fn env(&self) -> &Environment
pub fn env(&self) -> &Environment
Return a reference to the current environment.
Sourcepub fn stats(&self) -> &CheckStats
pub fn stats(&self) -> &CheckStats
Return a reference to the current statistics.
Trait Implementations§
Source§impl Default for EnvBuilder
impl Default for EnvBuilder
Source§fn default() -> EnvBuilder
fn default() -> EnvBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EnvBuilder
impl RefUnwindSafe for EnvBuilder
impl Send for EnvBuilder
impl Sync for EnvBuilder
impl Unpin for EnvBuilder
impl UnsafeUnpin for EnvBuilder
impl UnwindSafe for EnvBuilder
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