Struct erg_compiler::ty::free::Free
source · pub struct Free<T>(_);
Implementations§
source§impl<T: CanbeFree> Free<T>
impl<T: CanbeFree> Free<T>
pub fn unbound_name(&self) -> Option<Str>
pub fn constraint(&self) -> Option<Constraint>
source§impl<T> Free<T>
impl<T> Free<T>
pub fn borrow(&self) -> Ref<'_, FreeKind<T>>
pub fn borrow_mut(&self) -> RefMut<'_, FreeKind<T>>
sourcepub fn as_ptr(&self) -> *mut FreeKind<T>
pub fn as_ptr(&self) -> *mut FreeKind<T>
very unsafe, use force_replace
instead whenever possible
pub fn forced_as_ref(&self) -> &FreeKind<T>
pub fn force_replace(&self, new: FreeKind<T>)
pub fn can_borrow(&self) -> bool
pub fn can_borrow_mut(&self) -> bool
source§impl<T: Clone + HasLevel + LimitedDisplay> Free<T>
impl<T: Clone + HasLevel + LimitedDisplay> 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 replace(&self, to: FreeKind<T>)
sourcepub fn forced_link(&self, to: &T)
pub fn forced_link(&self, to: &T)
NOTE: Do not use this except to rewrite circular references.
No reference to any type variable may be left behind when rewriting.
However, get_bound_types
is safe because it does not return references.
pub fn undoable_link(&self, to: &T)
sourcepub fn forced_undoable_link(&self, to: &T)
pub fn forced_undoable_link(&self, to: &T)
NOTE: Do not use this except to rewrite circular references.
No reference to any type variable may be left behind when rewriting.
However, get_bound_types
is safe because it does not return references.
pub fn undo(&self)
pub fn unwrap_unbound(self) -> (Option<Str>, usize, Constraint)
pub fn unwrap_linked(self) -> T
pub fn detach(&self) -> Self
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