pub trait TreeMetrics<E: ContentTraits>{
type Update: Debug + Default + PartialEq + Eq;
type Value: Copy + Clone + Default + Debug + AddAssign + SubAssign + PartialEq + Eq + Sized;
const CAN_COUNT_ITEMS: bool = false;
// Required methods
fn increment_marker(marker: &mut Self::Update, entry: &E);
fn decrement_marker(marker: &mut Self::Update, entry: &E);
fn decrement_marker_by_val(marker: &mut Self::Update, val: &Self::Value);
fn update_offset_by_marker(offset: &mut Self::Value, by: &Self::Update);
fn increment_offset(offset: &mut Self::Value, by: &E);
// Provided method
fn count_items(_idx: Self::Value) -> usize { ... }
}
Expand description
The index describes which fields we’re tracking, and can query. Indexes let us convert cursors to positions and vice versa.
Provided Associated Constants§
const CAN_COUNT_ITEMS: bool = false
Required Associated Types§
type Update: Debug + Default + PartialEq + Eq
type Value: Copy + Clone + Default + Debug + AddAssign + SubAssign + PartialEq + Eq + Sized
Required Methods§
fn increment_marker(marker: &mut Self::Update, entry: &E)
fn decrement_marker(marker: &mut Self::Update, entry: &E)
fn decrement_marker_by_val(marker: &mut Self::Update, val: &Self::Value)
fn update_offset_by_marker(offset: &mut Self::Value, by: &Self::Update)
fn increment_offset(offset: &mut Self::Value, by: &E)
Provided Methods§
fn count_items(_idx: Self::Value) -> usize
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.