Enum Where

Source
pub enum Where<'a> {
    And(Vec<Where<'a>>),
    Or(Vec<Where<'a>>),
    Not(Box<Where<'a>>),
    Raw(SqlChunk<'a>),
    Empty,
}
Expand description

An enum representing the WHERE clause of a query.

Variants§

§

And(Vec<Where<'a>>)

A number of conditions joined by AND.

§

Or(Vec<Where<'a>>)

A number of conditions joined by OR.

§

Not(Box<Where<'a>>)

A negated condition.

§

Raw(SqlChunk<'a>)

A raw condition.

§

Empty

An empty WHERE clause.

Implementations§

Source§

impl<'a> Where<'a>

Source

pub fn and(self, other: Where<'a>) -> Where<'a>

Combine two conditions using AND.

You can also use the & operator.

Source

pub fn or(self, other: Where<'a>) -> Where<'a>

Combine two conditions using OR.

You can also use the | operator.

§Example
Where::new("id = ?", vec![&7])
    .or(Where::new("name = ?", vec![&"John"]))

Trait Implementations§

Source§

impl<'a> BitAnd for Where<'a>

Source§

type Output = Where<'a>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<'a> BitOr for Where<'a>

Source§

type Output = Where<'a>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<'a> Default for Where<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> Not for Where<'a>

Source§

type Output = Where<'a>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Where<'a>

§

impl<'a> !RefUnwindSafe for Where<'a>

§

impl<'a> Send for Where<'a>

§

impl<'a> Sync for Where<'a>

§

impl<'a> Unpin for Where<'a>

§

impl<'a> !UnwindSafe for Where<'a>

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V