Skip to main content

Live

Enum Live 

Source
pub enum Live<'l> {
    All,
    None,
    Mask(&'l Bitmap),
}
Expand description

A Validity borrowed as a Copy value, so a row loop can decide the case once.

The three cases are the same three. The difference is that this is a small Copy value rather than a shared reference to one, and that is what lets the compiler lift the match out of a row loop. Through a &Validity it cannot: the loops that ask row by row also call into code the compiler cannot see through, it has to assume one of those calls could write through the reference, and so it reloads the discriminant and re-decides the case on every row.

The note at the top of this file says the cost of knowing which case you are in is one branch per vector rather than one per value. Read through Validity::is_valid that is true wherever the compiler can see the whole loop and false wherever it cannot. Read through this it is true either way, because there is no reference left for a call inside the loop to have written through.

How much that is worth is small and worth saying plainly. On q01 it is 0.54 percent of the query, which is the one place it shows up at all, because q01’s decimals arrive as a dictionary over a packed run and the four packed loops are where the reference was surviving. q10 and q18 both come out inside their own control spread, which is to say unchanged.

Variants§

§

All

Nothing is null.

§

None

Everything is null.

§

Mask(&'l Bitmap)

Some of each, one bit per value, set meaning valid.

Implementations§

Source§

impl Live<'_>

Source

pub fn at(self, index: usize) -> bool

Whether the value at index is not null.

The same answer Validity::is_valid gives for the same row, including reporting invalid rather than panicking for a read past the end of a partially filled vector.

Trait Implementations§

Source§

impl<'l> Clone for Live<'l>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'l> Copy for Live<'l>

Source§

impl<'l> Debug for Live<'l>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'l> Eq for Live<'l>

Source§

impl<'l> PartialEq for Live<'l>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'l> StructuralPartialEq for Live<'l>

Auto Trait Implementations§

§

impl<'l> Freeze for Live<'l>

§

impl<'l> RefUnwindSafe for Live<'l>

§

impl<'l> Send for Live<'l>

§

impl<'l> Sync for Live<'l>

§

impl<'l> Unpin for Live<'l>

§

impl<'l> UnsafeUnpin for Live<'l>

§

impl<'l> UnwindSafe for Live<'l>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.