Skip to main content

RowSetOps

Trait RowSetOps 

Source
pub trait RowSetOps: Clone + Sized {
    type Row;

    // Required methods
    fn is_empty(&self) -> bool;
    fn len(&self) -> Option<u64>;
    fn remove(&mut self, row: Self::Row) -> bool;
    fn contains(&self, row: Self::Row) -> bool;
    fn union_all(other: &[&Self]) -> Self;
    fn from_sorted_iter<I>(iter: I) -> Result<Self>
       where I: IntoIterator<Item = Self::Row>;
}
Expand description

Common operations over a set of rows (either row ids or row addresses).

The concrete representation can be address-based (RowAddrTreeMap) or id-based (for example a future RowIdSet), but the semantics are the same: a set of unique rows.

Required Associated Types§

Source

type Row

Logical row handle (u64 for both row ids and row addresses).

Required Methods§

Source

fn is_empty(&self) -> bool

Returns true if the set is empty.

Source

fn len(&self) -> Option<u64>

Returns the number of rows in the set, if it is known.

Implementations that cannot always compute an exact size (for example because of “full fragment” markers) should return None.

Source

fn remove(&mut self, row: Self::Row) -> bool

Remove a value from the row set.

Source

fn contains(&self, row: Self::Row) -> bool

Returns whether this set contains the given row.

Source

fn union_all(other: &[&Self]) -> Self

Returns the union of other and init self.

Source

fn from_sorted_iter<I>(iter: I) -> Result<Self>
where I: IntoIterator<Item = Self::Row>,

Builds a row set from an iterator of rows.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§