Skip to main content

DiscreteWeave

Trait DiscreteWeave 

Source
pub trait DiscreteWeave<K, N, T>: Weave<K, N, T>
where K: Hash + Copy + Eq + Ord, N: Node<K, T>, T: DiscreteContents,
{ // Required methods fn split_node(&mut self, id: &K, at: usize, new_id: K) -> bool; fn merge_with_parent(&mut self, id: &K) -> Option<K>; }
Expand description

A Weave where the contents of Node objects can be split and merged.

Required Methods§

Source

fn split_node(&mut self, id: &K, at: usize, new_id: K) -> bool

Splits a node with the specified identifier at the given index, creating a new child node with the identifier new_id.

Returns false if splitting the node failed or the node could not be found.

Source

fn merge_with_parent(&mut self, id: &K) -> Option<K>

Merges a node with the specified identifier with its parent, with the newly merged node inheriting the parent’s identifier.

Returns the identifier of the merged node if merging was successful.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K, T, M, S> DiscreteWeave<K, DependentNode<K, T, S>, T> for DependentWeave<K, T, M, S>
where K: Hash + Copy + Eq + Ord, T: DiscreteContents, S: BuildHasher + Default + Clone,

Source§

impl<K, T, M, S> DiscreteWeave<K, IndependentNode<K, T, S>, T> for IndependentWeave<K, T, M, S>

Source§

impl<W, K, N, T, M> DiscreteWeave<K, N, T> for LoggedWeave<W, K, N, T, M>
where W: DiscreteWeave<K, N, T>, K: Hash + Copy + Eq + Ord, N: Node<K, T> + Clone, T: DiscreteContents,

Source§

impl<W, K, N, T> DiscreteWeave<K, N, T> for CountedWeave<W, K, N, T>
where W: DiscreteWeave<K, N, T>, K: Hash + Copy + Eq + Ord, N: Node<K, T>, T: DiscreteContents,