Struct idx_binary::IdxBinary
source · pub struct IdxBinary { /* private fields */ }Implementations§
source§impl IdxBinary
impl IdxBinary
sourcepub fn new<P: AsRef<Path>>(path: P, allocation_lot: u32) -> Self
pub fn new<P: AsRef<Path>>(path: P, allocation_lot: u32) -> Self
Opens the file and creates the IdxBinary.
§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 bytes(&self, row: NonZeroU32) -> Option<&[u8]>
pub fn bytes(&self, row: NonZeroU32) -> Option<&[u8]>
Returns the value of the specified row. Returns None if the row does not exist.
sourcepub fn update(&mut self, row: NonZeroU32, content: &Vec<u8>)
pub fn update(&mut self, row: NonZeroU32, content: &Vec<u8>)
Updates the byte string of the specified row. If row does not exist, it will be expanded automatically..
Methods from Deref<Target = Avltriee<T, I, IdxFileAllocator<T>>>§
pub fn rows_count(&self) -> u32
pub fn rows_count(&self) -> u32
Return count of rows.
pub fn iter(&self) -> AvltrieeIter<'_, T, I, A> ⓘ
pub fn iter(&self) -> AvltrieeIter<'_, T, I, A> ⓘ
Generate an iterator.
pub fn desc_iter(&self) -> AvltrieeIter<'_, T, I, A> ⓘ
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> ⓘ
pub fn iter_by<'a>(&'a self, value: &I) -> AvltrieeIter<'a, 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> ⓘ
pub fn iter_from<'a>(&'a self, value: &I) -> AvltrieeIter<'a, 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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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.
pub fn search(&self, value: &I) -> Foundwhere
Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,
pub fn search(&self, value: &I) -> Foundwhere
Avltriee<T, I, A>: AvltrieeOrd<T, I, A>,
Finds the edge of a node from the specified value.
pub fn search_edge(&self, o: &impl AvltrieeOrd<T, I, A>, value: &I) -> Found
pub fn search_edge(&self, o: &impl AvltrieeOrd<T, I, A>, value: &I) -> Found
Finds the edge of a node from the specified value with custom ord.
pub fn search_ge(
&self,
o: &impl AvltrieeOrd<T, I, A>,
value: &I
) -> Option<NonZero<u32>>
pub fn search_ge( &self, o: &impl AvltrieeOrd<T, I, A>, value: &I ) -> Option<NonZero<u32>>
Search >= value with custom ord.
pub fn search_le(
&self,
o: &impl AvltrieeOrd<T, I, A>,
value: &I
) -> Option<NonZero<u32>>
pub fn search_le( &self, o: &impl AvltrieeOrd<T, I, A>, value: &I ) -> Option<NonZero<u32>>
Search <= value with custom ord.
pub fn search_gt(
&self,
o: &impl AvltrieeOrd<T, I, A>,
value: &I
) -> Option<NonZero<u32>>
pub fn search_gt( &self, o: &impl AvltrieeOrd<T, I, A>, value: &I ) -> Option<NonZero<u32>>
Search > value with custom ord.
pub fn search_lt(
&self,
o: &impl AvltrieeOrd<T, I, A>,
value: &I
) -> Option<NonZero<u32>>
pub fn search_lt( &self, o: &impl AvltrieeOrd<T, I, A>, value: &I ) -> Option<NonZero<u32>>
Search < value with custom ord.
pub fn search_range(
&self,
o: &impl AvltrieeOrd<T, I, A>,
start_value: &I,
end_value: &I
) -> Option<Range<NonZero<u32>>>
pub fn search_range( &self, o: &impl AvltrieeOrd<T, I, A>, start_value: &I, end_value: &I ) -> Option<Range<NonZero<u32>>>
Search with range value with custom ord.
pub fn update(&mut self, row: NonZero<u32>, value: &I)
pub fn update(&mut self, row: NonZero<u32>, value: &I)
Updates the value in the specified row. 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.
pub unsafe fn insert_unique_unchecked(
&mut self,
row: NonZero<u32>,
value: T,
found: Found
)
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.
pub fn get(&self, row: NonZero<u32>) -> Option<&AvltrieeNode<T>>
pub fn get(&self, row: NonZero<u32>) -> Option<&AvltrieeNode<T>>
Returns the node of the specified row.