Skip to main content

Observed

Struct Observed 

Source
pub struct Observed {
    pub rows: u64,
    pub nulls: u64,
    pub distinct: bool,
    pub sorted: bool,
    pub min: Option<i128>,
    pub max: Option<i128>,
}
Expand description

What the build saw while it read the parent key column.

This is the cardinality verification of section 2.3, and it is written into the header rather than recomputed because the build already had every value in front of it. Recording what was observed rather than what was declared is what keeps a wrong FOREIGN KEY from producing a wrong answer: a declaration that fails verification is reported, and no link is built.

Fields§

§rows: u64

Non-null values seen.

§nulls: u64

Nulls seen, which are not keys and match no child row.

§distinct: bool

Whether every non-null value was distinct. False means no link may be built at all.

§sorted: bool

Whether the values arrived in non-decreasing order.

§min: Option<i128>

The smallest non-null value, or None when there were none.

§max: Option<i128>

The largest non-null value, or None when there were none.

Implementations§

Source§

impl Observed

Source

pub fn usable_as_parent(&self) -> bool

Whether this column can be the parent side of a link.

Distinctness is the whole requirement. A parent side that is not unique is not an error and is not a link: section 2.3 says it is a relationship that has to be executed as an ordinary join, and the planner is told so rather than left to find out.

Trait Implementations§

Source§

impl Clone for Observed

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 Copy for Observed

Source§

impl Debug for Observed

Source§

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

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

impl Eq for Observed

Source§

impl PartialEq for Observed

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 StructuralPartialEq for Observed

Auto Trait Implementations§

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.