pub trait Frontier: Focus + Sized {
type Item;
// Required methods
fn new(item: Self::Item) -> Self;
fn insert_owned(self, item: Self::Item) -> Result<Self, Full<Self>>;
fn update<T>(&mut self, f: impl FnOnce(&mut Self::Item) -> T) -> Option<T>;
fn focus(&self) -> Option<&Self::Item>;
fn is_full(&self) -> bool;
}
Available on crate feature
internal
only.Expand description
A frontier of a tree supporting the insertion of new elements and the updating of the most-recently-inserted element.
Required Associated Types§
Required Methods§
Sourcefn insert_owned(self, item: Self::Item) -> Result<Self, Full<Self>>
fn insert_owned(self, item: Self::Item) -> Result<Self, Full<Self>>
Sourcefn update<T>(&mut self, f: impl FnOnce(&mut Self::Item) -> T) -> Option<T>
fn update<T>(&mut self, f: impl FnOnce(&mut Self::Item) -> T) -> Option<T>
Update the currently focused Insert<Self::Item>
(i.e. the most-recently
insert
one), returning the result of the function.
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.