Skip to main content

OccupiedEntry

Struct OccupiedEntry 

Source
pub struct OccupiedEntry<'a, P, Tag>
where P: Pointer, P::Target: AvlItem<Tag>,
{ /* private fields */ }

Implementations§

Source§

impl<'a, P, Tag> OccupiedEntry<'a, P, Tag>
where P: Pointer, P::Target: AvlItem<Tag>,

Source

pub fn get(&self) -> &'a P::Target

Source

pub fn clone_ref(&self) -> P

Source

pub fn remove(self) -> P

Remove the node from the tree

Source

pub fn remove_prev(&mut self) -> Option<P>

Remove the next node if it exists and return the reference, without changing the current position.

Source

pub fn remove_next(&mut self) -> Option<P>

Remove the next node if it exists and return the reference, without changing the current position.

Source

pub fn peek_prev(&self) -> Option<&'a P::Target>

Source

pub fn peek_next(&self) -> Option<&'a P::Target>

Source

pub fn move_prev(self) -> Option<Self>

Source

pub fn move_next(self) -> Option<Self>

Source

pub unsafe fn insert_prev_unchecked(&mut self, new_node: P)

Insert before the current node. The entry position is unchanged.

§Safety

Caller should make sure the new_node is exactly before the current node.

otherwise the new_node is way smaller than its ancestor (with value not adjacent to current node) will break the tree total ordering.

Source

pub unsafe fn insert_move_prev_unchecked(self, new_node: P) -> Self

Insert before the current node, with entry position is changed to newly inserted node.

§Safety

Caller should make sure the new_node is exactly before the current node.

otherwise the new_node is way smaller than its ancestor (with value not adjacent to current node) will break the tree total ordering.

Source

pub unsafe fn insert_next_unchecked(&mut self, new_node: P)

Insert after the current node. The entry position is unchanged.

§Safety

Caller should make sure the new_node is exactly after the current node.

Otherwise the new_node is way smaller than its ancestor (with value not adjacent to current node) will break the tree total ordering.

Source

pub unsafe fn insert_move_next_unchecked(self, new_node: P) -> Self

Insert after the current node, with entry position is changed to newly inserted node.

§Safety

Caller should make sure the new_node is exactly after the current node.

Otherwise the new_node is way smaller than its ancestor (with value not adjacent to current node) will break the tree total ordering.

Trait Implementations§

Source§

impl<'a, P, Tag> AsRef<<P as Pointer>::Target> for OccupiedEntry<'a, P, Tag>
where P: Pointer, P::Target: AvlItem<Tag>,

Source§

fn as_ref(&self) -> &P::Target

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a, P, Tag> Deref for OccupiedEntry<'a, P, Tag>
where P: Pointer, P::Target: AvlItem<Tag>,

Source§

type Target = <P as Pointer>::Target

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, P, Tag> !Send for OccupiedEntry<'a, P, Tag>

§

impl<'a, P, Tag> !Sync for OccupiedEntry<'a, P, Tag>

§

impl<'a, P, Tag> !UnwindSafe for OccupiedEntry<'a, P, Tag>

§

impl<'a, P, Tag> Freeze for OccupiedEntry<'a, P, Tag>
where <P as Pointer>::Target: Sized, NonNull<<P as Pointer>::Target>: Freeze, &'a mut AvlTree<P, Tag>: Freeze,

§

impl<'a, P, Tag> RefUnwindSafe for OccupiedEntry<'a, P, Tag>
where <P as Pointer>::Target: Sized, NonNull<<P as Pointer>::Target>: RefUnwindSafe, &'a mut AvlTree<P, Tag>: RefUnwindSafe,

§

impl<'a, P, Tag> Unpin for OccupiedEntry<'a, P, Tag>
where <P as Pointer>::Target: Sized, NonNull<<P as Pointer>::Target>: Unpin, &'a mut AvlTree<P, Tag>: Unpin,

§

impl<'a, P, Tag> UnsafeUnpin for OccupiedEntry<'a, P, Tag>
where <P as Pointer>::Target: Sized, NonNull<<P as Pointer>::Target>: UnsafeUnpin, &'a mut AvlTree<P, Tag>: UnsafeUnpin,

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.