pub struct TypeEnv(pub BTreeMap<String, Type>);
Tuple Fields§
§0: BTreeMap<String, Type>
Implementations§
source§impl TypeEnv
impl TypeEnv
pub fn new() -> Self
pub fn merge<'a>(&'a mut self, env: &TypeEnv) -> Result<&'a mut Self>
pub fn merge_type(&mut self, env: TypeEnv, ty: Type) -> Type
pub fn find_type(&self, name: &str) -> Result<&Type>
pub fn rec_find_type(&self, name: &str) -> Result<&Type>
pub fn trace_type<'a>(&'a self, t: &'a Type) -> Result<Type>
pub fn as_func<'a>(&'a self, t: &'a Type) -> Result<&'a Function>
pub fn as_service<'a>(&'a self, t: &'a Type) -> Result<&'a [(String, Type)]>
pub fn get_method<'a>( &'a self, t: &'a Type, id: &'a str, ) -> Result<&'a Function>
pub fn replace_empty(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeEnv
impl RefUnwindSafe for TypeEnv
impl !Send for TypeEnv
impl !Sync for TypeEnv
impl Unpin for TypeEnv
impl UnwindSafe for TypeEnv
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)