Trait penumbra_tct::internal::interface::Frontier
source · 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.
Object Safety§
This trait is not object safe.