Struct idx_binary::Avltriee

pub struct Avltriee<T, I = T, A = VecAvltrieeAllocator<T>>
where I: ?Sized,
{ /* private fields */ }

Implementations§

§

impl<T, I, A> Avltriee<T, I, A>
where A: AvltrieeAllocator<T>, I: ?Sized,

pub fn rows_count(&self) -> u32

Return count of rows.

§

impl<T, I, A> Avltriee<T, I, A>
where A: AvltrieeAllocator<T>, I: ?Sized,

pub fn iter(&self) -> AvltrieeIter<'_, T, I, A>

Generate an iterator.

pub fn desc_iter(&self) -> AvltrieeIter<'_, T, I, A>

Generate an iterator. Iterates in descending order.

pub fn iter_by<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with the same value as the specified value.

pub fn iter_from<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator with values ​​starting from the specified value.

pub fn desc_iter_from<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator with values ​​starting from the specified value. Iterates in descending order.

pub fn iter_to<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with values ​​less than or equal to the specified value.

pub fn desc_iter_to<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with values ​​less than or equal to the specified value. Iterates in descending order.

pub fn iter_over<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with values ​​greater than the specified value.

pub fn desc_iter_over<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with values ​​greater than the specified value. Iterates in descending order.

pub fn iter_under<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

pub fn desc_iter_under<'a>(&'a self, value: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with values ​​less than the specified value. Iterates in descending order.

pub fn iter_range<'a>(&'a self, start: &I, end: &I) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with the specified range of values.

pub fn desc_iter_range<'a>( &'a self, start: &I, end: &I ) -> AvltrieeIter<'a, T, I, A>
where Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,

Generates an iterator of nodes with the specified range of values. Iterates in descending order.

§

impl<T, I, A> Avltriee<T, I, A>
where A: AvltrieeAllocator<T>, I: ?Sized,

pub fn insert(&mut self, value: &I) -> NonZero<u32>
where T: Clone, Avltriee<T, I, A>: AvltrieeUpdate<T, I, A>,

Creates a new row and assigns a value to it.

pub unsafe fn insert_unique_unchecked( &mut self, row: NonZero<u32>, value: T, found: Found )

Insert a unique value. If you specify a row that does not exist, space will be automatically allocated. If you specify a row that is too large, memory may be allocated unnecessarily.

§Safety

value ​​must be unique.

§

impl<T> Avltriee<T>
where T: Default,

pub fn new() -> Avltriee<T>

Creates the Avltriee with Default allocator.

§

impl<T, I, A> Avltriee<T, I, A>
where A: AvltrieeAllocator<T>, I: ?Sized,

pub fn with_allocator(allocator: A) -> Avltriee<T, I, A>

Creates the Avltriee with [AvltrieeAllocator].

pub fn get(&self, row: NonZero<u32>) -> Option<&AvltrieeNode<T>>

Returns the node of the specified row.

pub unsafe fn get_unchecked(&self, row: NonZero<u32>) -> &AvltrieeNode<T>

pub fn is_unique(&self, row: NonZero<u32>) -> Option<(bool, &AvltrieeNode<T>)>

Checks whether the specified row is a node with a unique value.

Trait Implementations§

source§

impl AsMut<Avltriee<DataAddress, [u8], IdxFileAllocator<DataAddress>>> for IdxBinary

source§

fn as_mut( &mut self ) -> &mut Avltriee<DataAddress, [u8], IdxFileAllocator<DataAddress>>

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

impl<T, I, A> AsMut<Avltriee<T, I, A>> for Avltriee<T, I, A>
where I: ?Sized,

§

fn as_mut(&mut self) -> &mut Avltriee<T, I, A>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<Avltriee<DataAddress, [u8], IdxFileAllocator<DataAddress>>> for IdxBinary

source§

fn as_ref(&self) -> &Avltriee<DataAddress, [u8], IdxFileAllocator<DataAddress>>

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

impl<T, I, A> AsRef<Avltriee<T, I, A>> for Avltriee<T, I, A>
where I: ?Sized,

§

fn as_ref(&self) -> &Avltriee<T, I, A>

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

impl<T, A> AvltrieeOrd<T, T, A> for Avltriee<T, T, A>
where T: Ord, A: AvltrieeAllocator<T>,

§

fn cmp(&self, left: &T, right: &T) -> Ordering

§

fn search(&self, value: &I) -> Found
where Self: Sized,

Finds the edge of a node from the specified value.
§

impl<T, A> AvltrieeUpdate<T, T, A> for Avltriee<T, T, A>
where T: Ord + Clone, A: AvltrieeAllocator<T>,

§

fn unique_value(&mut self, input: &T) -> T

§

fn on_delete(&mut self, _row: NonZero<u32>)

§

fn update(&mut self, row: NonZero<u32>, value: &I)
where T: Clone, Self: Sized,

Updates the value in the specified row.
§

fn delete(&mut self, row: NonZero<u32>)

Delete the specified row.

Auto Trait Implementations§

§

impl<T, I: ?Sized, A> RefUnwindSafe for Avltriee<T, I, A>
where A: RefUnwindSafe,

§

impl<T, I: ?Sized, A> Send for Avltriee<T, I, A>
where A: Send,

§

impl<T, I: ?Sized, A> Sync for Avltriee<T, I, A>
where A: Sync,

§

impl<T, I: ?Sized, A> Unpin for Avltriee<T, I, A>
where A: Unpin,

§

impl<T, I: ?Sized, A> UnwindSafe for Avltriee<T, I, A>
where A: 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>,

§

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.