pub struct ScopeOffset(pub u32);Expand description
The Debruijn index of the binder that introduced the variable
For example:
λx.∀y.λz. x z (y z)
λ ∀ λ 2 0 (1 0)Tuple Fields§
§0: u32Implementations§
Source§impl ScopeOffset
impl ScopeOffset
Sourcepub fn succ(self) -> ScopeOffset
pub fn succ(self) -> ScopeOffset
Move the current Debruijn index into an inner binder
pub fn pred(self) -> Option<ScopeOffset>
Trait Implementations§
Source§impl Clone for ScopeOffset
impl Clone for ScopeOffset
Source§fn clone(&self) -> ScopeOffset
fn clone(&self) -> ScopeOffset
Returns a duplicate 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 Debug for ScopeOffset
impl Debug for ScopeOffset
Source§impl Display for ScopeOffset
impl Display for ScopeOffset
Source§impl Hash for ScopeOffset
impl Hash for ScopeOffset
Source§impl Ord for ScopeOffset
impl Ord for ScopeOffset
Source§fn cmp(&self, other: &ScopeOffset) -> Ordering
fn cmp(&self, other: &ScopeOffset) -> 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
Source§impl PartialEq for ScopeOffset
impl PartialEq for ScopeOffset
Source§impl PartialOrd for ScopeOffset
impl PartialOrd for ScopeOffset
impl Copy for ScopeOffset
impl Eq for ScopeOffset
impl StructuralPartialEq for ScopeOffset
Auto Trait Implementations§
impl Freeze for ScopeOffset
impl RefUnwindSafe for ScopeOffset
impl Send for ScopeOffset
impl Sync for ScopeOffset
impl Unpin for ScopeOffset
impl UnwindSafe for ScopeOffset
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more