Type Definition erg_compiler::ty::free::FreeTyVar
source · pub type FreeTyVar = Free<Type>;
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 can_borrow(&self) -> bool
pub fn can_borrow_mut(&self) -> bool
source§impl<T> Free<T>
impl<T> 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 replace(&self, to: FreeKind<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 is_linked(&self) -> bool
pub fn is_undoable_linked(&self) -> bool
pub fn is_named_unbound(&self) -> bool
pub fn is_unnamed_unbound(&self) -> bool
pub fn unsafe_crack(&self) -> &T
pub fn addr_eq(&self, other: &Self) -> bool
source§impl<T: Clone> Free<T>
impl<T: Clone> Free<T>
pub fn undo(&self)
pub fn unwrap_unbound(self) -> (Option<Str>, usize, Constraint)
pub fn unwrap_linked(self) -> T
pub fn get_linked(&self) -> Option<T>
pub fn get_linked_ref(&self) -> Option<Ref<'_, T>>
pub fn get_linked_refmut(&self) -> Option<RefMut<'_, T>>
pub fn get_previous(&self) -> Option<Ref<'_, Box<FreeKind<T>>>>
pub fn detach(&self) -> Self
source§impl<T: CanbeFree> Free<T>
impl<T: CanbeFree> Free<T>
pub fn get_type(&self) -> Option<Type>
pub fn get_subsup(&self) -> Option<(Type, Type)>
pub fn is_unbound(&self) -> bool
pub fn constraint_is_typeof(&self) -> bool
pub fn constraint_is_sandwiched(&self) -> bool
pub fn constraint_is_uninited(&self) -> bool
sourcepub fn update_constraint(
&self,
new_constraint: Constraint,
in_inst_or_gen: bool
)
pub fn update_constraint( &self, new_constraint: Constraint, in_inst_or_gen: bool )
if in_inst_or_gen
is true, constraint will be updated forcibly
pub fn update_sub<F>(&self, f: F)where F: FnOnce(Type) -> Type,
pub fn update_super<F>(&self, f: F)where F: FnOnce(Type) -> Type,
Trait Implementations§
source§impl<T: LimitedDisplay> Display for Free<T>
impl<T: LimitedDisplay> Display for Free<T>
source§impl<T: LimitedDisplay> LimitedDisplay for Free<T>
impl<T: LimitedDisplay> LimitedDisplay for Free<T>
source§impl PartialEq<Free<Type>> for Free<Type>
impl PartialEq<Free<Type>> for Free<Type>
source§impl<T: StructuralEq + CanbeFree + Clone + Default> StructuralEq for Free<T>
impl<T: StructuralEq + CanbeFree + Clone + Default> StructuralEq for Free<T>
fn structural_eq(&self, other: &Self) -> bool
impl Eq for Free<Type>
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§
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