pub struct Environment { /* private fields */ }Expand description
Type checking environment
Contains:
- Word definitions (name -> effect signature)
- Type definitions (name -> ADT definition)
- Built-in primitives
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn lookup_word(&self, name: &str) -> Option<&Effect>
pub fn lookup_word(&self, name: &str) -> Option<&Effect>
Look up a word’s effect signature
Sourcepub fn lookup_type(&self, name: &str) -> Option<&TypeDef>
pub fn lookup_type(&self, name: &str) -> Option<&TypeDef>
Look up a type definition
Sourcepub fn get_variants(&self, type_name: &str) -> Option<&[Variant]>
pub fn get_variants(&self, type_name: &str) -> Option<&[Variant]>
Get all variants for a sum type (for exhaustiveness checking)
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
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 Environment
impl Debug 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 UnsafeUnpin 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