Struct idx_binary::IdxFile
source · pub struct IdxFile<T> { /* private fields */ }Implementations§
source§impl<T> IdxFile<T>
impl<T> IdxFile<T>
sourcepub fn new<P>(path: P, allocation_lot: u32) -> IdxFile<T>
pub fn new<P>(path: P, allocation_lot: u32) -> IdxFile<T>
Opens the file and creates the IdxFile
Arguments
path- Path of file to save dataallocation_lot- Extends the specified size when the file size becomes insufficient due to data addition. If you expect to add a lot of data, specifying a larger size will improve performance.
sourcepub fn value(&self, row: NonZeroU32) -> Option<&T>
pub fn value(&self, row: NonZeroU32) -> Option<&T>
Gets the value of the specified row. Returns None if a non-existent row is specified.
sourcepub fn allocate(&mut self, min_capacity: NonZeroU32)
pub fn allocate(&mut self, min_capacity: NonZeroU32)
Expand data storage space.
Arguments
min_capacity- Specify the number of rows to expand. If allocation_lot is a larger value, it may be expanded by allocation_lot.
sourcepub fn create_row(&mut self) -> NonZeroU32
pub fn create_row(&mut self) -> NonZeroU32
Add capacity for new row.
sourcepub async fn insert(&mut self, value: T) -> NonZeroU32
pub async fn insert(&mut self, value: T) -> NonZeroU32
Creates a new row and assigns a value to it..
sourcepub async fn update_with_allocate(&mut self, row: NonZeroU32, value: T)
pub async fn update_with_allocate(&mut self, row: NonZeroU32, value: T)
Updates the value of the specified row. If capacity is insufficient, it will be expanded automatically.
sourcepub fn exists(&self, row: NonZeroU32) -> bool
pub fn exists(&self, row: NonZeroU32) -> bool
Check if row exists.
Methods from Deref<Target = Avltriee<T>>§
pub fn iter(&self) -> AvltrieeIter<'_, T> ⓘ
pub fn iter(&self) -> AvltrieeIter<'_, T> ⓘ
Generate an iterator.
pub fn desc_iter(&self) -> AvltrieeIter<'_, T> ⓘ
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> ⓘ
pub fn iter_by<F, 'a>(&'a self, cmp: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn iter_from<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T> ⓘ
Generates an iterator with values starting from the specified value.
pub fn desc_iter_from<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T> ⓘ
pub fn desc_iter_from<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn iter_over<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn desc_iter_over<F, 'a>(&'a self, search: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn iter_to<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn desc_iter_to<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn iter_under<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn desc_iter_under<F, 'a>(&'a self, search_from: F) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn iter_range<S, E, 'a>(&'a self, start: S, end: E) -> AvltrieeIter<'a, T> ⓘ
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> ⓘ
pub fn desc_iter_range<S, E, 'a>( &'a self, start: S, end: E ) -> AvltrieeIter<'a, T> ⓘ
Generates an iterator of nodes with the specified range of values. Iterates in descending order.
pub fn delete(&mut self, row: NonZeroU32)
pub fn delete(&mut self, row: NonZeroU32)
Delete the specified row.
pub async unsafe fn update(&mut self, row: NonZeroU32, value: T)
pub async unsafe fn update(&mut self, row: NonZeroU32, value: T)
pub unsafe fn insert_unique_unchecked(
&mut self,
row: NonZeroU32,
value: T,
found: Found
)
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.
pub unsafe fn node<'a>(&self, row: NonZeroU32) -> Option<&'a AvltrieeNode<T>>
pub unsafe fn node<'a>(&self, row: NonZeroU32) -> Option<&'a AvltrieeNode<T>>
pub unsafe fn value(&self, row: NonZeroU32) -> Option<&T>
pub unsafe fn value(&self, row: NonZeroU32) -> Option<&T>
pub unsafe fn value_unchecked(&self, row: NonZeroU32) -> &T
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
pub fn search_end<F>(&self, cmp: F) -> Found
Finds the end of node from the specified value. Exact match double returns Ordering::Equal.
pub unsafe fn is_unique(&self, row: NonZeroU32) -> bool
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.