Struct raw_btree::RawBTree

source ·
pub struct RawBTree<T, S: Storage<T> = BoxStorage> { /* private fields */ }

Implementations§

source§

impl<T, S: Storage<T>> RawBTree<T, S>

source

pub fn new() -> RawBTree<T, S>

Create a new empty B-tree.

source

pub fn is_empty(&self) -> bool

source

pub fn len(&self) -> usize

source

pub fn address_of<Q: ?Sized>( &self, cmp: impl Fn(&T, &Q) -> Ordering, key: &Q ) -> Result<Address<S::Node>, Option<Address<S::Node>>>

source

pub fn first_item_address(&self) -> Option<Address<S::Node>>

source

pub unsafe fn get_at(&self, addr: Address<S::Node>) -> Option<&T>

Return the item at the given address.

§Safety

The address’s node must not have been deallocated.

source

pub unsafe fn get_mut_at(&mut self, addr: Address<S::Node>) -> Option<&mut T>

Returns a mutable reference to the item at the given address.

§Safety

The address’s node must not have been deallocated.

source

pub fn get<Q: ?Sized>( &self, cmp: impl Fn(&T, &Q) -> Ordering, key: &Q ) -> Option<&T>

source

pub fn get_mut<Q: ?Sized>( &mut self, cmp: impl Fn(&T, &Q) -> Ordering, key: &Q ) -> Option<&mut T>

source

pub fn first(&self) -> Option<&T>

source

pub fn first_mut(&mut self) -> Option<&mut T>

source

pub fn last(&self) -> Option<&T>

source

pub fn last_mut(&mut self) -> Option<&mut T>

source

pub fn iter(&self) -> Iter<'_, T, S>

source

pub fn iter_mut(&mut self) -> IterMut<'_, T, S>

source

pub fn insert(&mut self, cmp: impl Fn(&T, &T) -> Ordering, item: T) -> Option<T>

source

pub fn remove<Q: ?Sized>( &mut self, cmp: impl Fn(&T, &Q) -> Ordering, key: &Q ) -> Option<T>

Remove the next item and return it.

source

pub fn visit_from_leaves(&self, f: impl FnMut(S::Node))

source

pub fn visit_from_leaves_mut(&mut self, f: impl FnMut(S::Node, &mut Node<T, S>))

source

pub fn forget(&mut self)

source

pub fn clear(&mut self)

source

pub fn validate(&self, cmp: impl Fn(&T, &T) -> Ordering)

source

pub fn validate_node( &self, cmp: &impl Fn(&T, &T) -> Ordering, id: S::Node, parent: Option<S::Node>, min: Option<&T>, max: Option<&T> ) -> usize

Validate the given node and returns the depth of the node.

Trait Implementations§

source§

impl<T: Clone, S: Clone + Storage<T>> Clone for RawBTree<T, S>
where S::Node: Clone,

source§

fn clone(&self) -> RawBTree<T, S>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T, S: Storage<T>> Default for RawBTree<T, S>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T, S: Storage<T>> Drop for RawBTree<T, S>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, S: Storage<T>> IntoIterator for &'a RawBTree<T, S>

§

type IntoIter = Iter<'a, T, S>

Which kind of iterator are we turning this into?
§

type Item = &'a T

The type of the elements being iterated over.
source§

fn into_iter(self) -> Iter<'a, T, S>

Creates an iterator from a value. Read more
source§

impl<'a, T, S: Storage<T>> IntoIterator for &'a mut RawBTree<T, S>

§

type IntoIter = IterMut<'a, T, S>

Which kind of iterator are we turning this into?
§

type Item = &'a mut T

The type of the elements being iterated over.
source§

fn into_iter(self) -> IterMut<'a, T, S>

Creates an iterator from a value. Read more
source§

impl<T, S: Storage<T>> IntoIterator for RawBTree<T, S>

§

type IntoIter = IntoIter<T, S>

Which kind of iterator are we turning this into?
§

type Item = T

The type of the elements being iterated over.
source§

fn into_iter(self) -> IntoIter<T, S>

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, S> RefUnwindSafe for RawBTree<T, S>

§

impl<T, S> Send for RawBTree<T, S>
where S: Send, T: Send, <S as Storage<T>>::Node: Send,

§

impl<T, S> Sync for RawBTree<T, S>
where S: Sync, T: Sync, <S as Storage<T>>::Node: Sync,

§

impl<T, S> Unpin for RawBTree<T, S>
where S: Unpin, T: Unpin, <S as Storage<T>>::Node: Unpin,

§

impl<T, S> UnwindSafe for RawBTree<T, S>
where S: UnwindSafe, T: UnwindSafe, <S as Storage<T>>::Node: 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> ToOwned for T
where T: Clone,

§

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

§

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

§

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.