Skip to main content

Column

Struct Column 

Source
pub struct Column<R, V> { /* private fields */ }
Expand description

A column of the row type R, holding Vs: generated as a constant of the row struct, such as Issue::TITLE.

Implementations§

Source§

impl<R, V> Column<R, V>

Source

pub const fn new(name: &'static str) -> Self

The column named name (its client name). For generated code.

Source

pub fn name(&self) -> &'static str

The column’s client name.

Source

pub fn cmp_param(self, op: SimpleOperator, param: &StaticParameter) -> Condition

Compares the column with a value of the context, such as the auth data.

Source§

impl<R, V: ZeroValue> Column<R, V>

Source

pub fn cmp(self, op: SimpleOperator, value: V) -> Condition

Compares the column with value by op.

Source

pub fn eq(self, value: V) -> Condition

Equal to value. Comparing with null uses IS, since = NULL matches nothing.

Source

pub fn ne(self, value: V) -> Condition

Not equal to value; with null, IS NOT.

Source

pub fn lt(self, value: V) -> Condition

The column is less than value.

Source

pub fn le(self, value: V) -> Condition

The column is at most value.

Source

pub fn gt(self, value: V) -> Condition

The column is greater than value.

Source

pub fn ge(self, value: V) -> Condition

The column is at least value.

Source

pub fn is(self, value: V) -> Condition

The column IS value: as =, but null matches null.

Source

pub fn is_not(self, value: V) -> Condition

The column IS NOT value: as !=, but null matches non-null values.

Source

pub fn is_in(self, values: Vec<V>) -> Condition

IN.

Source

pub fn not_in(self, values: Vec<V>) -> Condition

NOT IN.

Source§

impl<R> Column<R, String>

Source

pub fn like(self, pattern: &str) -> Condition

The column matches the SQL LIKE pattern, with % and _ as wildcards (like::escape_like escapes them).

Source

pub fn not_like(self, pattern: &str) -> Condition

The column doesn’t match the LIKE pattern.

Source

pub fn ilike(self, pattern: &str) -> Condition

The column matches the pattern ignoring case (ILIKE).

Source

pub fn not_ilike(self, pattern: &str) -> Condition

The column doesn’t match the pattern ignoring case (NOT ILIKE).

Source§

impl<R> Column<R, Option<String>>

Source

pub fn like(self, pattern: &str) -> Condition

The column matches the SQL LIKE pattern, with % and _ as wildcards (like::escape_like escapes them).

Source

pub fn not_like(self, pattern: &str) -> Condition

The column doesn’t match the LIKE pattern.

Source

pub fn ilike(self, pattern: &str) -> Condition

The column matches the pattern ignoring case (ILIKE).

Source

pub fn not_ilike(self, pattern: &str) -> Condition

The column doesn’t match the pattern ignoring case (NOT ILIKE).

Trait Implementations§

Source§

impl<R, V> Clone for Column<R, V>

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<R, V> Copy for Column<R, V>

Source§

impl<R, V> Debug for Column<R, V>

Source§

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

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

impl<R, V> From<Column<R, V>> for ColumnRef<R>

Source§

fn from(c: Column<R, V>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<R, V> Forget for Column<R, V>

§

impl<R, V> Freeze for Column<R, V>
where PhantomData<fn() -> (R, V)>: Freeze,

§

impl<R, V> Move for Column<R, V>

§

impl<R, V> RefUnwindSafe for Column<R, V>

§

impl<R, V> Send for Column<R, V>
where PhantomData<fn() -> (R, V)>: Send,

§

impl<R, V> Sync for Column<R, V>
where PhantomData<fn() -> (R, V)>: Sync,

§

impl<R, V> Unpin for Column<R, V>
where PhantomData<fn() -> (R, V)>: Unpin,

§

impl<R, V> UnsafeUnpin for Column<R, V>

§

impl<R, V> UnwindSafe for Column<R, V>

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

Source§

type Output = T

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