Struct idx_binary::Avltriee

pub struct Avltriee<T> { /* private fields */ }

Implementations§

§

impl<T> Avltriee<T>

pub fn capacity(&self) -> u32

Returns capacity.

§

impl<T> Avltriee<T>

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

Generate an iterator.

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

Generate an iterator. Iterates in descending order.

pub fn iter_by<F, 'a>(&'a self, cmp: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn iter_from<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn desc_iter_from<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn iter_over<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn desc_iter_over<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn iter_to<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn desc_iter_to<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn iter_under<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn desc_iter_under<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T>
where F: Fn(&T) -> Ordering,

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

pub fn iter_range<S, E, 'a>(&'a self, start: S, end: E) -> AvltrieeIter<'a, T>
where S: Fn(&T) -> Ordering, E: Fn(&T) -> Ordering,

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

pub fn desc_iter_range<S, E, 'a>( &'a self, start: S, end: E ) -> AvltrieeIter<'a, T>
where S: Fn(&T) -> Ordering, E: Fn(&T) -> Ordering,

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

§

impl<T> Avltriee<T>

pub fn delete(&mut self, row: NonZeroU32)

Delete the specified row.

§

impl<T> Avltriee<T>

pub async unsafe fn update(&mut self, row: NonZeroU32, value: T)
where T: Ord + Copy,

Updates the value in the specified row.

Safety

Specifies a row within the allocated memory range.

pub async unsafe fn update_with_holder<I>( holder: &mut dyn AvltrieeHolder<T, I>, row: NonZeroU32, input: I )
where T: Copy,

Updates the value of the specified row via trait AvltrieeHolder.

Safety

Specifies a row within the allocated memory range.

pub unsafe fn insert_unique_unchecked( &mut self, row: NonZeroU32, value: T, found: Found )

Insert a unique value.

Safety

Specifies a row within the allocated memory range.Values ​​must be unique. There is no error checking if you try to insert a non-unique value. There will be multiple duplicate soot values ​​in the node list.

§

impl<T> Avltriee<T>

pub fn new(node_list: NonNull<AvltrieeNode<T>>) -> Avltriee<T>

Creates the Avltriee. #Examples

use std::ptr::NonNull;
use avltriee::{Avltriee,AvltrieeNode};
let mut list: Vec<AvltrieeNode<i64>> = (0..=100)
    .map(|_| AvltrieeNode::new(0, 0, 0))
    .collect();
let mut t = Avltriee::new(unsafe { NonNull::new_unchecked(list.as_mut_ptr()) });

pub unsafe fn node<'a>(&self, row: NonZeroU32) -> Option<&'a AvltrieeNode<T>>

Returns the node of the specified row.

Safety

Specifies a row within the allocated memory range.

pub unsafe fn value(&self, row: NonZeroU32) -> Option<&T>

Returns the value of the specified row.

Safety

Specifies a row within the allocated memory range..

pub unsafe fn value_unchecked(&self, row: NonZeroU32) -> &T

Returns the value of the specified row. Does not check for the existence of row.

Safety

Specifies a row within the allocated memory range..

pub fn search_end<F>(&self, cmp: F) -> Found
where F: Fn(&T) -> Ordering,

Finds the end of node from the specified value. Exact match double returns Ordering::Equal.

pub unsafe fn is_unique(&self, row: NonZeroU32) -> bool

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

Safety

Specifies a row within the allocated memory range.

Trait Implementations§

§

impl<T> AsMut<Avltriee<T>> for Avltriee<T>

§

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

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

impl<T> AsMut<Avltriee<T>> for IdxBinary<T>

source§

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

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

impl<T> AsRef<Avltriee<T>> for Avltriee<T>

§

fn as_ref(&self) -> &Avltriee<T>

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

impl<T> AsRef<Avltriee<T>> for IdxBinary<T>

source§

fn as_ref(&self) -> &Avltriee<T>

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

impl<T> AvltrieeHolder<T, T> for Avltriee<T>
where T: Ord,

§

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

§

fn search_end(&self, input: &T) -> Found

§

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

§

fn delete_before_update<'life0, 'life1, 'async_trait>( &'life0 mut self, row: NonZeroU32, _: &'life1 T ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Avltriee<T>: 'async_trait,

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Avltriee<T>
where T: RefUnwindSafe,

§

impl<T> !Send for Avltriee<T>

§

impl<T> !Sync for Avltriee<T>

§

impl<T> Unpin for Avltriee<T>

§

impl<T> UnwindSafe for Avltriee<T>
where T: RefUnwindSafe,

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.