Rindle docs and package mapSkip to main content

Cond

Struct Cond 

Source
pub struct Cond { /* private fields */ }
Expand description

A boolean condition group under construction — the building block for nested AND/OR filter trees. You don’t make one directly; a fresh Cond is handed to the closure of Query::where_any / Query::where_all (and the nested Cond::any / Cond::all). Add clauses by chaining, just like Query.

No correlations here. A correlation (row.col(..)) is a property of an EXISTS subquery, never of a free-standing condition, so Cond::where takes a plain literal (impl IntoLit). To correlate, nest a Cond::where_exists whose child query carries the row.col(..) link.

Implementations§

Source§

impl Cond

Source

pub fn where(self, field: &str, value: impl IntoLit) -> Cond

field = value (a literal — see the type docs on why correlations don’t belong in a group).

Source

pub fn where_op(self, field: &str, op: impl IntoOp, value: impl IntoLit) -> Cond

field <op> value with an explicit operator ("<", ">=", "LIKE", … or an Op).

Source

pub fn where_in<V: IntoLit>( self, field: &str, values: impl IntoIterator<Item = V>, ) -> Cond

field IN (values…).

Source

pub fn where_exists(self, f: impl FnOnce(ParentRow) -> Query) -> Cond

EXISTS (<correlated subquery>) — same closure/correlation mechanism as Query::where_exists.

Source

pub fn where_exists_with( self, f: impl FnOnce(ParentRow) -> Query, opts: ExistsOpts, ) -> Cond

Cond::where_exists with ExistsOpts (e.g. { scalar: true }).

Source

pub fn where_not_exists(self, f: impl FnOnce(ParentRow) -> Query) -> Cond

NOT EXISTS (<correlated subquery>).

Source

pub fn where_not_exists_with( self, f: impl FnOnce(ParentRow) -> Query, opts: ExistsOpts, ) -> Cond

Source

pub fn where_exists_no_sync(self, f: impl FnOnce(ParentRow) -> Query) -> Cond

EXISTS (<correlated subquery>) as a server-only, non-syncing gate — the nestable form of Query::where_exists_no_sync.

Source

pub fn where_not_exists_no_sync( self, f: impl FnOnce(ParentRow) -> Query, ) -> Cond

NOT EXISTS (<correlated subquery>) as a server-only, non-syncing gate — the nestable form of Query::where_not_exists_no_sync.

Source

pub fn any(self, f: impl FnOnce(Cond) -> Cond) -> Cond

Nest an OR sub-group: (… OR …).

Source

pub fn all(self, f: impl FnOnce(Cond) -> Cond) -> Cond

Nest an AND sub-group: (… AND …).

Auto Trait Implementations§

§

impl Freeze for Cond

§

impl RefUnwindSafe for Cond

§

impl Send for Cond

§

impl Sync for Cond

§

impl Unpin for Cond

§

impl UnsafeUnpin for Cond

§

impl UnwindSafe for Cond

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.