Struct erg_common::ty::Free
source · [−]pub struct Free<T>(_);
Implementations
sourceimpl<T: Clone + HasLevel> Free<T>
impl<T: Clone + HasLevel> Free<T>
pub fn new(f: FreeKind<T>) -> Self
pub fn new_unbound(level: Level, constraint: Constraint) -> Self
pub fn new_named_unbound(name: Str, level: Level, constraint: Constraint) -> Self
pub fn new_linked(t: T) -> Self
pub fn link(&self, to: &T)
pub fn update_level(&self, level: Level)
pub fn lift(&self)
pub fn level(&self) -> Option<Level>
pub fn update_constraint(&self, new_constraint: Constraint)
pub fn get_name(&self) -> Option<Str>
pub fn unwrap_unbound(self) -> (Option<Str>, usize, Constraint)
pub fn unwrap_linked(self) -> T
sourcepub fn crack(&self) -> Ref<'_, T>
pub fn crack(&self) -> Ref<'_, T>
returns linked type (panic if self is unbounded)
NOTE: check by .is_linked
before call
pub fn crack_constraint(&self) -> Ref<'_, Constraint>
pub fn type_of(&self) -> Option<Type>
pub fn subtype_of(&self) -> Option<Type>
pub fn is_unbound(&self) -> bool
pub fn constraint_is_typeof(&self) -> bool
pub fn constraint_is_supertypeof(&self) -> bool
pub fn constraint_is_subtypeof(&self) -> bool
pub fn constraint_is_sandwiched(&self) -> bool
pub fn is_linked(&self) -> bool
pub fn unbound_name(&self) -> Option<Str>
pub fn borrow(&self) -> Ref<'_, FreeKind<T>>
pub fn borrow_mut(&self) -> RefMut<'_, FreeKind<T>>
Trait Implementations
impl<T: Eq> Eq for Free<T>
impl<T> StructuralEq for Free<T>
impl<T> StructuralPartialEq for Free<T>
Auto Trait Implementations
impl<T> !RefUnwindSafe for Free<T>
impl<T> !Send for Free<T>
impl<T> !Sync for Free<T>
impl<T> Unpin for Free<T>
impl<T> !UnwindSafe for Free<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more