pub struct EnvBuilder { /* private fields */ }Expand description
A thin wrapper around Environment providing convenience methods for
registering axioms and definitions during standard library initialisation.
Implementations§
Source§impl EnvBuilder
impl EnvBuilder
Sourcepub fn new(env: Environment) -> Self
pub fn new(env: Environment) -> Self
Create a new builder from an existing environment.
Sourcepub fn add_definition(&mut self, name: Name, ty: Expr, value: Expr)
pub fn add_definition(&mut self, name: Name, ty: Expr, value: Expr)
Add a definition with the given name, type, and value.
Sourcepub fn def(&mut self, name: &str, ty: Expr, value: Expr) -> &mut Self
pub fn def(&mut self, name: &str, ty: Expr, value: Expr) -> &mut Self
Add a definition using a &str name (builder-style).
Sourcepub fn theorem(&mut self, name: &str, ty: Expr, proof: Expr) -> &mut Self
pub fn theorem(&mut self, name: &str, ty: Expr, proof: Expr) -> &mut Self
Add a theorem (opaque definition) using a &str name.
Sourcepub fn sorry(&mut self, name: &str, ty: Expr) -> &mut Self
pub fn sorry(&mut self, name: &str, ty: Expr) -> &mut Self
Add a Sorry opaque axiom — useful for placeholder proofs.
Sourcepub fn finish(self) -> Result<Environment, String>
pub fn finish(self) -> Result<Environment, String>
Finish building and return the environment, or an error string.
Sourcepub fn finish_or_panic(self) -> Environment
pub fn finish_or_panic(self) -> Environment
Finish building, panicking on any error. Useful in tests.
Sourcepub fn env(&self) -> &Environment
pub fn env(&self) -> &Environment
Get a reference to the underlying environment.
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