pub struct ValueColumn<T> { /* private fields */ }Expand description
A column of values, with the rows of each distinct value.
A row can have one value, several, or none at all. It can also be a wildcard, in which case it matches any value asked for.
Implementations§
Source§impl<T: Hash + Eq> ValueColumn<T>
impl<T: Hash + Eq> ValueColumn<T>
Sourcepub fn rows<Q>(&self, value: &Q) -> Option<&RowSet>
pub fn rows<Q>(&self, value: &Q) -> Option<&RowSet>
The rows with the given value, wildcards not included.
Sourcepub fn values(&self) -> impl Iterator<Item = (&T, &RowSet)>
pub fn values(&self) -> impl Iterator<Item = (&T, &RowSet)>
The distinct values of the column and their rows.
Sourcepub fn filter<'a, Q>(
&'a self,
plan: &mut Plan<'a>,
slot: usize,
value: &Q,
any: bool,
)
pub fn filter<'a, Q>( &'a self, plan: &mut Plan<'a>, slot: usize, value: &Q, any: bool, )
Make the slot of the plan also match the given value, next to the values it matches already.
Pass any as true to only match the wildcard rows.
Sourcepub fn filter_where<'a>(
&'a self,
plan: &mut Plan<'a>,
predicate: impl FnMut(&T) -> bool,
)
pub fn filter_where<'a>( &'a self, plan: &mut Plan<'a>, predicate: impl FnMut(&T) -> bool, )
Make the plan match the values for which the predicate returns true.
The predicate is called once per distinct value, not once per row.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Release the memory the column does not need.
Trait Implementations§
Source§impl<T: Clone> Clone for ValueColumn<T>
impl<T: Clone> Clone for ValueColumn<T>
Source§impl<T: Debug> Debug for ValueColumn<T>
impl<T: Debug> Debug for ValueColumn<T>
Auto Trait Implementations§
impl<T> Forget for ValueColumn<T>
impl<T> Freeze for ValueColumn<T>
impl<T> Move for ValueColumn<T>
impl<T> RefUnwindSafe for ValueColumn<T>
impl<T> Send for ValueColumn<T>
impl<T> Sync for ValueColumn<T>
impl<T> Unpin for ValueColumn<T>
impl<T> UnsafeUnpin for ValueColumn<T>
impl<T> UnwindSafe for ValueColumn<T>
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
Mutably borrows from an owned value. Read more