pub type TypeDbVar = DeBruijnVar<TypeVarId>;
Aliased Type§
enum TypeDbVar {
Bound(DeBruijnId, TypeVarId),
Free(TypeVarId),
}
Variants§
Bound(DeBruijnId, TypeVarId)
A variable attached to the nth binder, counting from the innermost.
Free(TypeVarId)
A variable attached to the outermost binder (the one on the item). As explained above, This is not used in charon internals, only as a micro-pass before exporting the crate data.
Implementations
Source§impl<Id> DeBruijnVar<Id>where
Id: Copy,
impl<Id> DeBruijnVar<Id>where
Id: Copy,
pub fn new_at_zero(id: Id) -> Self
pub fn free(id: Id) -> Self
pub fn bound(index: DeBruijnId, id: Id) -> Self
pub fn incr(&self) -> Self
pub fn decr(&self) -> Self
Sourcepub fn bound_at_depth(&self, depth: DeBruijnId) -> Option<Id>
pub fn bound_at_depth(&self, depth: DeBruijnId) -> Option<Id>
Returns the variable id if it is bound as the given depth.
Sourcepub fn bound_at_depth_mut(&mut self, depth: DeBruijnId) -> Option<&mut Id>
pub fn bound_at_depth_mut(&mut self, depth: DeBruijnId) -> Option<&mut Id>
Returns the variable id if it is bound as the given depth.
Sourcepub fn move_out_from_depth(&self, depth: DeBruijnId) -> Option<Self>
pub fn move_out_from_depth(&self, depth: DeBruijnId) -> Option<Self>
Move the variable out of depth
binders. Returns None
if the variable is bound in one of
these depth
binders.
Sourcepub fn move_under_binders(&self, depth: DeBruijnId) -> Self
pub fn move_under_binders(&self, depth: DeBruijnId) -> Self
Move under depth
binders.
Trait Implementations
Source§impl<T: AstVisitable + Idx> AstVisitable for DeBruijnVar<T>
impl<T: AstVisitable + Idx> AstVisitable for DeBruijnVar<T>
Source§fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>
Recursively visit this type with the provided visitor. This calls the visitor’s
visit_$any
method if it exists, otherwise visit_inner
.Source§fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>
Recursively visit this type with the provided visitor. This calls the visitor’s
visit_$any
method if it exists, otherwise visit_inner
.Source§fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))
fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))
Visit all occurrences of that type inside
self
, in pre-order traversal.Source§fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))
fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))
Visit all occurrences of that type inside
self
, in pre-order traversal.Source§impl<Id: Clone> Clone for DeBruijnVar<Id>
impl<Id: Clone> Clone for DeBruijnVar<Id>
Source§fn clone(&self) -> DeBruijnVar<Id>
fn clone(&self) -> DeBruijnVar<Id>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Id: Debug> Debug for DeBruijnVar<Id>
impl<Id: Debug> Debug for DeBruijnVar<Id>
Source§impl<'de, Id> Deserialize<'de> for DeBruijnVar<Id>where
Id: Deserialize<'de>,
impl<'de, Id> Deserialize<'de> for DeBruijnVar<Id>where
Id: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Id> Display for DeBruijnVar<Id>where
Id: Display,
impl<Id> Display for DeBruijnVar<Id>where
Id: Display,
Source§impl<'s, Id, V> Drive<'s, V> for DeBruijnVar<Id>where
V: Visitor + Visit<'s, DeBruijnId> + Visit<'s, Id>,
impl<'s, Id, V> Drive<'s, V> for DeBruijnVar<Id>where
V: Visitor + Visit<'s, DeBruijnId> + Visit<'s, Id>,
Source§fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner(&'s self, visitor: &mut V) -> ControlFlow<V::Break>
Call
v.visit()
on the immediate contents of self
.Source§impl<'s, Id, V> DriveMut<'s, V> for DeBruijnVar<Id>where
V: Visitor + VisitMut<'s, DeBruijnId> + VisitMut<'s, Id>,
impl<'s, Id, V> DriveMut<'s, V> for DeBruijnVar<Id>where
V: Visitor + VisitMut<'s, DeBruijnId> + VisitMut<'s, Id>,
Source§fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn drive_inner_mut(&'s mut self, visitor: &mut V) -> ControlFlow<V::Break>
Call
v.visit()
on the immediate contents of self
.Source§impl<Id: Hash> Hash for DeBruijnVar<Id>
impl<Id: Hash> Hash for DeBruijnVar<Id>
Source§impl<Id: Ord> Ord for DeBruijnVar<Id>
impl<Id: Ord> Ord for DeBruijnVar<Id>
Source§fn cmp(&self, other: &DeBruijnVar<Id>) -> Ordering
fn cmp(&self, other: &DeBruijnVar<Id>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more