pub struct RowIdTreeMap { /* private fields */ }
Expand description
A collection of row ids.
These row ids may either be stable-style (where they can be an incrementing u64 sequence) or address style, where they are a fragment id and a row offset. When address style, this supports setting entire fragments as selected, without needing to enumerate all the ids in the fragment.
This is similar to a [RoaringTreemap] but it is optimized for the case where entire fragments are selected or deselected.
Implementations§
Source§impl RowIdTreeMap
impl RowIdTreeMap
pub fn is_empty(&self) -> bool
Sourcepub fn len(&self) -> Option<u64>
pub fn len(&self) -> Option<u64>
The number of rows in the map
If there are any “full fragment” items then this is unknown and None is returned
Sourcepub fn row_ids(&self) -> Option<impl Iterator<Item = RowAddress> + '_>
pub fn row_ids(&self) -> Option<impl Iterator<Item = RowAddress> + '_>
An iterator of row ids
If there are any “full fragment” items then this can’t be calculated and None is returned
Sourcepub fn insert(&mut self, value: u64) -> bool
pub fn insert(&mut self, value: u64) -> bool
Insert a single value into the set
Returns true if the value was not already in the set.
use lance_core::utils::mask::RowIdTreeMap;
let mut set = RowIdTreeMap::new();
assert_eq!(set.insert(10), true);
assert_eq!(set.insert(10), false);
assert_eq!(set.contains(10), true);
Sourcepub fn insert_range<R: RangeBounds<u64>>(&mut self, range: R) -> u64
pub fn insert_range<R: RangeBounds<u64>>(&mut self, range: R) -> u64
Insert a range of values into the set
Sourcepub fn insert_bitmap(&mut self, fragment: u32, bitmap: RoaringBitmap)
pub fn insert_bitmap(&mut self, fragment: u32, bitmap: RoaringBitmap)
Add a bitmap for a single fragment
Sourcepub fn insert_fragment(&mut self, fragment_id: u32)
pub fn insert_fragment(&mut self, fragment_id: u32)
Add a whole fragment to the set
pub fn remove(&mut self, value: u64) -> bool
pub fn retain_fragments(&mut self, frag_ids: impl IntoIterator<Item = u32>)
Sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
Compute the serialized size of the set.
Sourcepub fn serialize_into<W: Write>(&self, writer: W) -> Result<()>
pub fn serialize_into<W: Write>(&self, writer: W) -> Result<()>
Serialize the set into the given buffer
The serialization format is not stable.
The serialization format is:
- u32: num_entries
for each entry:
- u32: fragment_id
- u32: bitmap size
- If bitmap size is zero then the entire fragment is selected.
Sourcepub fn deserialize_from<R: Read>(reader: R) -> Result<Self>
pub fn deserialize_from<R: Read>(reader: R) -> Result<Self>
Deserialize the set from the given buffer
pub fn union_all(maps: &[&Self]) -> Self
Trait Implementations§
Source§impl BitAnd for RowIdTreeMap
impl BitAnd for RowIdTreeMap
Source§impl BitAndAssign for RowIdTreeMap
impl BitAndAssign for RowIdTreeMap
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&=
operation. Read moreSource§impl BitOr for RowIdTreeMap
impl BitOr for RowIdTreeMap
Source§impl BitOrAssign for RowIdTreeMap
impl BitOrAssign for RowIdTreeMap
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|=
operation. Read moreSource§impl Clone for RowIdTreeMap
impl Clone for RowIdTreeMap
Source§fn clone(&self) -> RowIdTreeMap
fn clone(&self) -> RowIdTreeMap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RowIdTreeMap
impl Debug for RowIdTreeMap
Source§impl DeepSizeOf for RowIdTreeMap
impl DeepSizeOf for RowIdTreeMap
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§impl Default for RowIdTreeMap
impl Default for RowIdTreeMap
Source§fn default() -> RowIdTreeMap
fn default() -> RowIdTreeMap
Source§impl<'a> Extend<&'a u64> for RowIdTreeMap
impl<'a> Extend<&'a u64> for RowIdTreeMap
Source§fn extend<T: IntoIterator<Item = &'a u64>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a u64>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Extend<RowIdTreeMap> for RowIdTreeMap
impl Extend<RowIdTreeMap> for RowIdTreeMap
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Extend<u64> for RowIdTreeMap
impl Extend<u64> for RowIdTreeMap
Source§fn extend<T: IntoIterator<Item = u64>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = u64>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<'a> FromIterator<&'a u64> for RowIdTreeMap
impl<'a> FromIterator<&'a u64> for RowIdTreeMap
Source§impl FromIterator<u64> for RowIdTreeMap
impl FromIterator<u64> for RowIdTreeMap
Source§impl PartialEq for RowIdTreeMap
impl PartialEq for RowIdTreeMap
Source§impl SubAssign<&RowIdTreeMap> for RowIdTreeMap
impl SubAssign<&RowIdTreeMap> for RowIdTreeMap
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-=
operation. Read moreimpl StructuralPartialEq for RowIdTreeMap
Auto Trait Implementations§
impl Freeze for RowIdTreeMap
impl RefUnwindSafe for RowIdTreeMap
impl Send for RowIdTreeMap
impl Sync for RowIdTreeMap
impl Unpin for RowIdTreeMap
impl UnwindSafe for RowIdTreeMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more