Skip to main content

Cursor

Struct Cursor 

Source
pub struct Cursor<'a, K, P, Tag = DefaultObjectTag, S = NonTrackingSize, O = DefaultWavlTreeObserver<<P as PtrTraits>::Target>>
where P: PtrTraits, P::Target: WavlTreeContainable<P::Target, Tag> + WavlTreeKeyable<K>, K: Ord, S: SizeTracker, O: WavlTreeObserver<Target = P::Target>,
{ /* private fields */ }
Expand description

A read-only cursor positioned in a WavlTree.

Implementations§

Source§

impl<'a, K, P, Tag, S, O> Cursor<'a, K, P, Tag, S, O>
where P: PtrTraits, P::Target: WavlTreeContainable<P::Target, Tag> + WavlTreeKeyable<K>, K: Ord, S: SizeTracker, O: WavlTreeObserver<Target = P::Target>,

Source

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

Returns a reference to the current element, or None if the cursor is at the sentinel.

Source

pub fn is_valid(&self) -> bool

Returns true if the cursor is positioned at a valid element (not the sentinel).

Source

pub fn left(&self) -> Self

Returns a cursor positioned at the left child of the current element. If the current element is the sentinel, returns a cursor at the sentinel.

Source

pub fn right(&self) -> Self

Returns a cursor positioned at the right child of the current element.

Source

pub fn parent(&self) -> Self

Returns a cursor positioned at the parent of the current element.

Source

pub fn as_raw_ptr(&self) -> *mut P::Target

Returns the raw pointer to the current element. This may be a sentinel pointer if the cursor is at the sentinel.

Trait Implementations§

Source§

impl<'a, K, P, Tag, S, O> Clone for Cursor<'a, K, P, Tag, S, O>
where P: PtrTraits, P::Target: WavlTreeContainable<P::Target, Tag> + WavlTreeKeyable<K>, K: Ord, S: SizeTracker, O: WavlTreeObserver<Target = P::Target>,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, K, P, Tag, S, O> Debug for Cursor<'a, K, P, Tag, S, O>
where P: PtrTraits, P::Target: WavlTreeContainable<P::Target, Tag> + WavlTreeKeyable<K>, K: Ord, S: SizeTracker, O: WavlTreeObserver<Target = P::Target>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, K, P, Tag, S, O> PartialEq for Cursor<'a, K, P, Tag, S, O>
where P: PtrTraits, P::Target: WavlTreeContainable<P::Target, Tag> + WavlTreeKeyable<K>, K: Ord, S: SizeTracker, O: WavlTreeObserver<Target = P::Target>,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, K, P, Tag, S, O> Copy for Cursor<'a, K, P, Tag, S, O>
where P: PtrTraits, P::Target: WavlTreeContainable<P::Target, Tag> + WavlTreeKeyable<K>, K: Ord, S: SizeTracker, O: WavlTreeObserver<Target = P::Target>,

Auto Trait Implementations§

§

impl<'a, K, P, Tag, S, O> Freeze for Cursor<'a, K, P, Tag, S, O>

§

impl<'a, K, P, Tag, S, O> RefUnwindSafe for Cursor<'a, K, P, Tag, S, O>

§

impl<'a, K, P, Tag = DefaultObjectTag, S = NonTrackingSize, O = DefaultWavlTreeObserver<<P as PtrTraits>::Target>> !Send for Cursor<'a, K, P, Tag, S, O>

§

impl<'a, K, P, Tag = DefaultObjectTag, S = NonTrackingSize, O = DefaultWavlTreeObserver<<P as PtrTraits>::Target>> !Sync for Cursor<'a, K, P, Tag, S, O>

§

impl<'a, K, P, Tag, S, O> Unpin for Cursor<'a, K, P, Tag, S, O>

§

impl<'a, K, P, Tag, S, O> UnsafeUnpin for Cursor<'a, K, P, Tag, S, O>

§

impl<'a, K, P, Tag, S, O> UnwindSafe for Cursor<'a, K, P, Tag, S, O>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

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

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
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> PinInit<T> for T

Source§

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

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.