pub trait KeyMngTrait<C: TreapMapConfig>: Default {
// Required methods
fn view_update(
&mut self,
key: &C::SearchKey,
value: Option<&C::Value>,
old_value: Option<&C::Value>,
);
fn len(&self) -> usize;
fn get_sort_key(&self, key: &C::SearchKey) -> Option<C::SortKey>;
fn make_sort_key(&self, key: &C::SearchKey, value: &C::Value) -> C::SortKey;
}
Expand description
Searching in Treap
requires sort key. This trait manages the relationship
among sort keys, search keys and values in a Treap. This is necessary when
the sort key is not directly derivable from the search key or is not a null
element.
Required Methods§
Sourcefn view_update(
&mut self,
key: &C::SearchKey,
value: Option<&C::Value>,
old_value: Option<&C::Value>,
)
fn view_update( &mut self, key: &C::SearchKey, value: Option<&C::Value>, old_value: Option<&C::Value>, )
Invoked when a new key-value pair is changed in the Treap.
Sourcefn get_sort_key(&self, key: &C::SearchKey) -> Option<C::SortKey>
fn get_sort_key(&self, key: &C::SearchKey) -> Option<C::SortKey>
Retrieve the sort key for a given search key.
Returns None
if the search key is not in the treap.
Sourcefn make_sort_key(&self, key: &C::SearchKey, value: &C::Value) -> C::SortKey
fn make_sort_key(&self, key: &C::SearchKey, value: &C::Value) -> C::SortKey
Generate the sort key from a key-value pair.
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.