pub struct Col<M, T> { /* private fields */ }Expand description
One column of the model M, whose Rust type is T (for example Option<String>).
A misspelled column or a value of the wrong type is a compile error:
use renox::db::Col;
struct Product;
const PRICE: Col<Product, i64> = Col::new("price");
let cheap = PRICE.lt(20_000);Implementations§
Source§impl<M, T> Col<M, T>
impl<M, T> Col<M, T>
Sourcepub fn eq<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
pub fn eq<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
column = value.
Sourcepub fn ne<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
pub fn ne<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
column != value.
Sourcepub fn lt<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
pub fn lt<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
column < value.
Sourcepub fn lte<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
pub fn lte<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
column <= value.
Sourcepub fn gt<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
pub fn gt<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
column > value.
Sourcepub fn gte<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
pub fn gte<V: ToDbValue>(self, value: V) -> Condition<M>where
T: Comparable<V>,
column >= value.
Sourcepub fn is_not_null(self) -> Condition<M>
pub fn is_not_null(self) -> Condition<M>
column IS NOT NULL.
Sourcepub fn is_in<V: ToDbValue>(
self,
values: impl IntoIterator<Item = V>,
) -> Condition<M>where
T: Comparable<V>,
pub fn is_in<V: ToDbValue>(
self,
values: impl IntoIterator<Item = V>,
) -> Condition<M>where
T: Comparable<V>,
column IN (…); an empty list matches no rows.
Trait Implementations§
impl<M, T> Copy for Col<M, T>
Source§impl<M, T> IntoColumn<M> for Col<M, T>
impl<M, T> IntoColumn<M> for Col<M, T>
Source§fn column_name(&self) -> &str
fn column_name(&self) -> &str
The column’s name.
Auto Trait Implementations§
impl<M, T> Freeze for Col<M, T>
impl<M, T> RefUnwindSafe for Col<M, T>
impl<M, T> Send for Col<M, T>
impl<M, T> Sync for Col<M, T>
impl<M, T> Unpin for Col<M, T>
impl<M, T> UnsafeUnpin for Col<M, T>
impl<M, T> UnwindSafe for Col<M, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more