pub struct WavlTreeAugmentedInvariantObserver<Tag, Traits, const ALLOW_FIND_COLLISION: bool = true, const ALLOW_REPLACE_COLLISION: bool = true> { /* private fields */ }Expand description
A WAVL tree observer that maintains augmented invariants.
Trait Implementations§
Source§impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> Default for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> Default for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>
Source§impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> WavlTreeObserver for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Traits: WavlTreeAugmentedInvariantObserverTraits,
Traits::Target: WavlTreeContainable<Traits::Target, Tag>,
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> WavlTreeObserver for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Traits: WavlTreeAugmentedInvariantObserverTraits,
Traits::Target: WavlTreeContainable<Traits::Target, Tag>,
Source§type Target = <Traits as WavlTreeAugmentedInvariantObserverTraits>::Target
type Target = <Traits as WavlTreeAugmentedInvariantObserverTraits>::Target
The type pointed to by the tree pointers.
Source§fn record_insert(&self, node: *mut Self::Target)
fn record_insert(&self, node: *mut Self::Target)
Invoked on the newly inserted node before rebalancing.
Source§fn record_insert_traverse(
&self,
_node: *mut Self::Target,
_ancestor: *mut Self::Target,
)
fn record_insert_traverse( &self, _node: *mut Self::Target, _ancestor: *mut Self::Target, )
Invoked on the node to be inserted and each ancestor node while traversing
the tree to find the initial insertion point.
Source§fn record_insert_collision(
&self,
_node: *mut Self::Target,
_collision: *mut Self::Target,
)
fn record_insert_collision( &self, _node: *mut Self::Target, _collision: *mut Self::Target, )
Invoked on the node to be inserted and the colliding node with the same
key, during an insert-or-find operation. This method is mutually exclusive
with
record_insert_replace, only one or the other is invoked during an
insert operation.Source§fn record_insert_replace(
&self,
node: *mut Self::Target,
replacement: *mut Self::Target,
)
fn record_insert_replace( &self, node: *mut Self::Target, replacement: *mut Self::Target, )
Invoked on an existing node and its replacement, before swapping the
replacement into the tree, during an insert-or-replace operation. This
method is mutually exclusive with
record_insert_collision, only one or the
other is invoked during an insert operation.Source§fn record_rotation(
&self,
pivot: *mut Self::Target,
lr_child: *mut Self::Target,
_rl_child: *mut Self::Target,
parent: *mut Self::Target,
sibling: *mut Self::Target,
)
fn record_rotation( &self, pivot: *mut Self::Target, lr_child: *mut Self::Target, _rl_child: *mut Self::Target, parent: *mut Self::Target, sibling: *mut Self::Target, )
Invoked on the pivot node, its parent, children, and sibling before a
rotation, just before updating the pointers in the relevant nodes. The
chirality of the children and sibling is relative to the direction of
rotation. The direction of rotation can be determined by comparing these
arguments with the values returned by the left and right child properties
of the pivot or parent arguments. Read more
Source§fn record_erase(&self, node: *mut Self::Target, invalidated: *mut Self::Target)
fn record_erase(&self, node: *mut Self::Target, invalidated: *mut Self::Target)
Invoked on the node to be erased and the node in the tree where the
augmented invariants become invalid, leading up to the root. Called just
after updating the pointers in the relevant nodes, but before rebalancing. Read more
Source§fn record_insert_promote(&self)
fn record_insert_promote(&self)
Invoked after each promotion during post-insert rebalancing.
Source§fn record_insert_rotation(&self)
fn record_insert_rotation(&self)
Invoked after a single rotation during post-insert rebalancing.
Source§fn record_insert_double_rotation(&self)
fn record_insert_double_rotation(&self)
Invoked after a double rotation during post-insert rebalancing.
Source§fn record_erase_demote(&self)
fn record_erase_demote(&self)
Invoked after each demotion during post-erase rebalancing.
Source§fn record_erase_rotation(&self)
fn record_erase_rotation(&self)
Invoked after each single rotation during post-erase rebalancing.
Source§fn record_erase_double_rotation(&self)
fn record_erase_double_rotation(&self)
Invoked after each double rotation during post-erase rebalancing.
Source§fn verify_rank_rule(
&self,
_node: *mut Self::Target,
_left_most: *mut Self::Target,
_right_most: *mut Self::Target,
_sentinel: *mut Self::Target,
)
fn verify_rank_rule( &self, _node: *mut Self::Target, _left_most: *mut Self::Target, _right_most: *mut Self::Target, _sentinel: *mut Self::Target, )
Invoked during testing to verify WAVL tree rank rules for a given node.
Source§fn verify_balance(&self, _size: usize, _depth: usize)
fn verify_balance(&self, _size: usize, _depth: usize)
Invoked during testing to verify tree balance properties given the tree size and depth.
Auto Trait Implementations§
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> Freeze for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> RefUnwindSafe for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Tag: RefUnwindSafe,
Traits: RefUnwindSafe,
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> Send for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Tag: Send,
Traits: Send,
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> Sync for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Tag: Sync,
Traits: Sync,
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> Unpin for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Tag: Unpin,
Traits: Unpin,
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> UnsafeUnpin for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>
impl<Tag, Traits, const ALLOW_FIND_COLLISION: bool, const ALLOW_REPLACE_COLLISION: bool> UnwindSafe for WavlTreeAugmentedInvariantObserver<Tag, Traits, ALLOW_FIND_COLLISION, ALLOW_REPLACE_COLLISION>where
Tag: UnwindSafe,
Traits: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>
Initializes
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
First initializes the value using
self then calls the function f with the initialized
value. Read more