Skip to main content

InternalTargetsRecursionlessTree

Struct InternalTargetsRecursionlessTree 

Source
pub struct InternalTargetsRecursionlessTree<T: LinkReference> { /* private fields */ }

Implementations§

Source§

impl<T: LinkReference> InternalTargetsRecursionlessTree<T>

Source

pub fn new( constants: LinksConstants<T>, data: NonNull<[DataPart<T>]>, indexes: NonNull<[IndexPart<T>]>, ) -> Self

Trait Implementations§

Source§

impl<T: LinkReference> IterativeSizeBalancedTree<T> for InternalTargetsRecursionlessTree<T>

Source§

unsafe fn attach(&mut self, root: *mut T, node: T)

Inserts node into the tree rooted at *root. Read more
Source§

unsafe fn detach(&mut self, root: *mut T, node: T)

Removes node from the tree rooted at *root. Read more
Source§

unsafe fn attach_core(&mut self, root: *mut T, node: T)

Source§

unsafe fn detach_core(&mut self, root: *mut T, node: T)

Source§

impl<T: LinkReference> LinksTree<T> for InternalTargetsRecursionlessTree<T>

Source§

fn count_usages(&self, link: T) -> T

Source§

fn search(&self, source: T, target: T) -> T

Source§

fn each_usages<H: FnMut(Link<T>) -> Flow + ?Sized>( &self, root: T, handler: &mut H, ) -> Flow

Source§

fn detach(&mut self, root: &mut T, index: T)

Source§

fn attach(&mut self, root: &mut T, index: T)

Source§

impl<T: LinkReference> RecursiveSizeBalancedTree<T> for InternalTargetsRecursionlessTree<T>

Source§

unsafe fn get_left_reference(&self, node: T) -> *const T

Returns a const raw pointer to the left-child field of node.
Source§

unsafe fn get_right_reference(&self, node: T) -> *const T

Returns a const raw pointer to the right-child field of node.
Source§

unsafe fn get_mut_left_reference(&mut self, node: T) -> *mut T

Returns a mutable raw pointer to the left-child field of node.
Source§

unsafe fn get_mut_right_reference(&mut self, node: T) -> *mut T

Returns a mutable raw pointer to the right-child field of node.
Source§

unsafe fn get_left(&self, node: T) -> T

Returns the left child of node.
Source§

unsafe fn get_right(&self, node: T) -> T

Returns the right child of node.
Source§

unsafe fn get_size(&self, node: T) -> T

Returns the subtree size stored at node.
Source§

unsafe fn set_left(&mut self, node: T, left: T)

Sets the left child of node.
Source§

unsafe fn set_right(&mut self, node: T, right: T)

Sets the right child of node.
Source§

unsafe fn set_size(&mut self, node: T, size: T)

Sets the subtree size of node.
Source§

unsafe fn first_is_to_the_left_of_second(&self, first: T, second: T) -> bool

Returns true if first should be placed to the left of second.
Source§

unsafe fn first_is_to_the_right_of_second(&self, first: T, second: T) -> bool

Returns true if first should be placed to the right of second.
Source§

unsafe fn clear_node(&mut self, node: T)

Resets node’s left, right, and size fields to zero.
Source§

unsafe fn get_left_or_default(&self, node: T) -> T

Returns the left child of node, or T::from_byte(0) if node is zero.
Source§

unsafe fn get_right_or_default(&self, node: T) -> T

Returns the right child of node, or T::from_byte(0) if node is zero.
Source§

unsafe fn get_size_or_zero(&self, node: T) -> T

Returns the size of node, or zero if node is zero.
Source§

unsafe fn inc_size(&mut self, node: T)

Increments the subtree size of node by one.
Source§

unsafe fn dec_size(&mut self, node: T)

Decrements the subtree size of node by one.
Source§

unsafe fn get_left_size(&self, node: T) -> T

Returns the size of the left subtree of node.
Source§

unsafe fn get_right_size(&self, node: T) -> T

Returns the size of the right subtree of node.
Source§

unsafe fn fix_size(&mut self, node: T)

Recalculates the size of node from its children: size = left_size + right_size + 1.
Source§

unsafe fn left_rotate(&mut self, root: *mut T)

Performs a left rotation at the subtree rooted at *root, updating *root in place.
Source§

unsafe fn left_rotate_core(&mut self, root: T) -> T

Performs a left rotation and returns the new root.
Source§

unsafe fn right_rotate(&mut self, root: *mut T)

Performs a right rotation at the subtree rooted at *root, updating *root in place.
Source§

unsafe fn right_rotate_core(&mut self, root: T) -> T

Performs a right rotation and returns the new root.
Source§

unsafe fn get_rightest(&self, current: T) -> T

Returns the rightmost (maximum) node in the subtree rooted at current.
Source§

unsafe fn get_leftest(&self, current: T) -> T

Returns the leftmost (minimum) node in the subtree rooted at current.
Source§

unsafe fn get_next(&self, node: T) -> T

Returns the in-order successor of node.
Source§

unsafe fn get_previous(&self, node: T) -> T

Returns the in-order predecessor of node.
Source§

unsafe fn contains(&self, node: T, root: T) -> bool

Returns true if node exists in the tree rooted at root.
Source§

impl<T: LinkReference> SplitTree<T> for InternalTargetsRecursionlessTree<T>

Source§

impl<T: LinkReference> SplitUpdateMem<T> for InternalTargetsRecursionlessTree<T>

Source§

fn update_mem( &mut self, data: NonNull<[DataPart<T>]>, indexes: NonNull<[IndexPart<T>]>, )

Auto Trait Implementations§

§

impl<T> !Send for InternalTargetsRecursionlessTree<T>

§

impl<T> !Sync for InternalTargetsRecursionlessTree<T>

§

impl<T> Freeze for InternalTargetsRecursionlessTree<T>
where InternalRecursionlessSizeBalancedTreeBase<T>: Freeze,

§

impl<T> RefUnwindSafe for InternalTargetsRecursionlessTree<T>
where InternalRecursionlessSizeBalancedTreeBase<T>: RefUnwindSafe,

§

impl<T> Unpin for InternalTargetsRecursionlessTree<T>
where InternalRecursionlessSizeBalancedTreeBase<T>: Unpin,

§

impl<T> UnsafeUnpin for InternalTargetsRecursionlessTree<T>
where InternalRecursionlessSizeBalancedTreeBase<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for InternalTargetsRecursionlessTree<T>
where InternalRecursionlessSizeBalancedTreeBase<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.