Skip to main content

RowScope

Enum RowScope 

Source
pub enum RowScope {
    All,
    Compare {
        column: String,
        value: SqlValue,
        ordering: Ordering,
        inclusive: bool,
    },
    Null {
        column: String,
        not: bool,
    },
    In {
        column: String,
        values: Vec<SqlValue>,
    },
    Row(Arc<RowCondition>),
    Joined {
        column: String,
        lookup: Arc<Lookup>,
    },
    Window(Arc<RowWindow>),
    And(Box<Self>, Box<Self>),
    Or(Box<Self>, Box<Self>),
}
Expand description

A predicate over a table’s rows. A change reruns a query when its row passes in its old or its new image.

Variants§

§

All

Every row.

§

Compare

Rows whose column compares with value as ordering, or equal too when inclusive.

Fields

§column: String

The tested column, lowercase.

§value: SqlValue

The value the scope compares the column with.

§ordering: Ordering

The order the column’s value has to value.

§inclusive: bool

Whether a value equal to value also passes.

§

Null

Rows whose column is NULL, or is not NULL when not.

Fields

§column: String

The tested column, lowercase.

§not: bool

Whether rows whose column is not NULL pass instead.

§

In

Rows whose column equals one of values, sorted in SQLite’s order with NULLs and repeats left out: made by RowScope::equal.

Fields

§column: String

The tested column, lowercase.

§values: Vec<SqlValue>

The values that pass, in SQLite’s order.

§

Row(Arc<RowCondition>)

Rows a condition on their columns holds for, which a write judges by asking SQLite (scope_row.rs).

§

Joined

Rows whose column equals a value some row of another source holds in its own scope: a join, which a write judges by running lookup.

Fields

§column: String

The joined column, lowercase.

§lookup: Arc<Lookup>

The question that finds partner rows holding a value.

§

Window(Arc<RowWindow>)

Rows that fewer than a subquery’s LIMIT rows of their window sort before, which a write judges by asking SQLite (scope_window.rs).

§

And(Box<Self>, Box<Self>)

Rows both scopes pass.

§

Or(Box<Self>, Box<Self>)

Rows either scope passes.

Implementations§

Source§

impl RowScope

Source

pub fn equal(column: String, values: Vec<Value>) -> Self

Rows whose column equals one of values.

Source

pub fn columns(&self, into: &mut BTreeSet<String>)

The columns this scope tests, lowercase.

Source

pub fn and(self, other: Self) -> Self

Both scopes: either alone when the other is every row.

Trait Implementations§

Source§

impl Clone for RowScope

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 Debug for RowScope

Source§

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

Formats the value using the given formatter. Read more

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more