pub struct Environment { /* private fields */ }Expand description
Global environment
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn add_decl(&mut self, decl: Declaration) -> Result<()>
pub fn add_decl(&mut self, decl: Declaration) -> Result<()>
Add a declaration to the environment
Sourcepub fn get_decl(&self, name: SymbolId) -> Option<&Declaration>
pub fn get_decl(&self, name: SymbolId) -> Option<&Declaration>
Get a declaration by name
Sourcepub fn add_inductive(&mut self, ind: InductiveDecl) -> Result<()>
pub fn add_inductive(&mut self, ind: InductiveDecl) -> Result<()>
Add an inductive type
Sourcepub fn get_inductive(&self, name: SymbolId) -> Option<&InductiveDecl>
pub fn get_inductive(&self, name: SymbolId) -> Option<&InductiveDecl>
Get an inductive type by name
Sourcepub fn get_inductive_of_constructor(
&self,
ctor: SymbolId,
) -> Option<&InductiveDecl>
pub fn get_inductive_of_constructor( &self, ctor: SymbolId, ) -> Option<&InductiveDecl>
Get the inductive type for a constructor
Sourcepub fn is_constructor(&self, name: SymbolId) -> bool
pub fn is_constructor(&self, name: SymbolId) -> bool
Check if a name is a constructor
Sourcepub fn declarations(&self) -> impl Iterator<Item = (&SymbolId, &Declaration)>
pub fn declarations(&self) -> impl Iterator<Item = (&SymbolId, &Declaration)>
Get all declarations
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Auto Trait Implementations§
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnwindSafe for Environment
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