pub trait DeBruijnIndexed: Sized {
// Required methods
fn map_indices_from<F>(&self, start: usize, map_fn: F) -> Self
where F: Fn(usize) -> usize + Clone;
fn get_var(&self) -> Option<usize>;
// Provided methods
fn map_indices<F>(&self, map_fn: F) -> Self
where F: Fn(usize) -> usize + Clone { ... }
fn increment_indices_from_by(&self, start: usize, amount: usize) -> Self { ... }
fn increment_indices_by(&self, amount: usize) -> Self { ... }
fn increment_indices(&self) -> Self { ... }
}Expand description
Syntax nodes which have free variables represented by DeBruijn indices
Required Methods§
fn map_indices_from<F>(&self, start: usize, map_fn: F) -> Self
fn get_var(&self) -> Option<usize>
Provided Methods§
fn map_indices<F>(&self, map_fn: F) -> Self
Sourcefn increment_indices_from_by(&self, start: usize, amount: usize) -> Self
fn increment_indices_from_by(&self, start: usize, amount: usize) -> Self
Increment de Bruijn indices in the term which are at least equal to start
by amount.
This is required for example, when adjusting de Bruijn indices in an
expression where new variables are bound.
Sourcefn increment_indices_by(&self, amount: usize) -> Self
fn increment_indices_by(&self, amount: usize) -> Self
Increment de Bruijn indices in the term by amount.
Sourcefn increment_indices(&self) -> Self
fn increment_indices(&self) -> Self
Increment de Bruijn indices in the term by one.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.