Enum erg_compiler::ty::free::FreeKind
source · pub enum FreeKind<T> {
Linked(T),
UndoableLinked {
t: T,
previous: Box<FreeKind<T>>,
},
Unbound {
id: Id,
lev: Level,
constraint: Constraint,
},
NamedUnbound {
name: Str,
lev: Level,
constraint: Constraint,
},
}
Variants§
Implementations§
source§impl<T: CanbeFree> FreeKind<T>
impl<T: CanbeFree> FreeKind<T>
pub fn unbound_name(&self) -> Option<Str>
pub fn constraint(&self) -> Option<Constraint>
source§impl<T> FreeKind<T>
impl<T> FreeKind<T>
pub const fn unbound(id: Id, lev: Level, constraint: Constraint) -> Self
pub fn new_unbound(lev: Level, constraint: Constraint) -> Self
pub const fn named_unbound( name: Str, lev: Level, constraint: Constraint ) -> Self
pub const fn linked(&self) -> Option<&T>
pub fn linked_mut(&mut self) -> Option<&mut T>
sourcepub fn replace(&mut self, to: T)
pub fn replace(&mut self, to: T)
SAFETY: carefully ensure that to
is not a freevar equal to self
e.g.
x = ?T
x.replace(Type::Free(?T))
x == (((...)))
pub const fn is_named_unbound(&self) -> bool
pub const fn is_unnamed_unbound(&self) -> bool
pub const fn is_undoable_linked(&self) -> bool
Trait Implementations§
source§impl<T: LimitedDisplay> Display for FreeKind<T>
impl<T: LimitedDisplay> Display for FreeKind<T>
source§impl<T: LimitedDisplay> LimitedDisplay for FreeKind<T>
impl<T: LimitedDisplay> LimitedDisplay for FreeKind<T>
source§impl<T: PartialEq> PartialEq<FreeKind<T>> for FreeKind<T>
impl<T: PartialEq> PartialEq<FreeKind<T>> for FreeKind<T>
impl<T: Eq> Eq for FreeKind<T>
impl<T> StructuralEq for FreeKind<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for FreeKind<T>
impl<T> !Send for FreeKind<T>
impl<T> !Sync for FreeKind<T>
impl<T> Unpin for FreeKind<T>where T: Unpin,
impl<T> !UnwindSafe for FreeKind<T>
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