Skip to main content

WavlTreeAugmentedInvariantObserver

Struct WavlTreeAugmentedInvariantObserver 

Source
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>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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>

Source§

type Target = <Traits as WavlTreeAugmentedInvariantObserverTraits>::Target

The type pointed to by the tree pointers.
Source§

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, )

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, )

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, )

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, )

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)

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)

Invoked after each promotion during post-insert rebalancing.
Source§

fn record_insert_rotation(&self)

Invoked after a single rotation during post-insert rebalancing.
Source§

fn record_insert_double_rotation(&self)

Invoked after a double rotation during post-insert rebalancing.
Source§

fn record_erase_demote(&self)

Invoked after each demotion during post-erase rebalancing.
Source§

fn record_erase_rotation(&self)

Invoked after each single rotation during post-erase rebalancing.
Source§

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, )

Invoked during testing to verify WAVL tree rank rules for a given node.
Source§

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Init<T> for T

Source§

unsafe fn __init(self, slot: *mut T) -> Result<(), !>

Initializes slot. Read more
Source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

Source§

impl<T> PinInit<T> for T

Source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>

Initializes slot. Read more
Source§

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
Source§

impl<T> ToMutPtr for T
where T: ?Sized,

Source§

type Target = T

The target type of the pointer.
Source§

fn to_mut_ptr(&self) -> *mut T

Casts the reference to a mutable raw pointer.
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.