pub struct ColumnRef<C>where
C: Column,{ /* private fields */ }Expand description
A typed column reference
This type is returned by column accessor methods on entities (e.g., User::email()).
It provides type-safe filter methods based on the column’s type.
Implementations§
Source§impl<C> ColumnRef<C>where
C: Column,
impl<C> ColumnRef<C>where
C: Column,
Sourcepub fn eq(self, value: C::Type) -> FilterExpr
pub fn eq(self, value: C::Type) -> FilterExpr
Equality filter: column = value
Sourcepub fn ne(self, value: C::Type) -> FilterExpr
pub fn ne(self, value: C::Type) -> FilterExpr
Inequality filter: column != value
Sourcepub fn gt(self, value: C::Type) -> FilterExpr
pub fn gt(self, value: C::Type) -> FilterExpr
Greater than: column > value
Sourcepub fn gte(self, value: C::Type) -> FilterExpr
pub fn gte(self, value: C::Type) -> FilterExpr
Greater than or equal: column >= value
Sourcepub fn lt(self, value: C::Type) -> FilterExpr
pub fn lt(self, value: C::Type) -> FilterExpr
Less than: column < value
Sourcepub fn lte(self, value: C::Type) -> FilterExpr
pub fn lte(self, value: C::Type) -> FilterExpr
Less than or equal: column <= value
Sourcepub fn in_list(self, values: Vec<C::Type>) -> FilterExpr
pub fn in_list(self, values: Vec<C::Type>) -> FilterExpr
IN clause: column IN (value1, value2, ...)
Sourcepub fn not_in(self, values: Vec<C::Type>) -> FilterExpr
pub fn not_in(self, values: Vec<C::Type>) -> FilterExpr
NOT IN clause: column NOT IN (value1, value2, ...)
Sourcepub fn between(self, low: C::Type, high: C::Type) -> FilterExpr
pub fn between(self, low: C::Type, high: C::Type) -> FilterExpr
BETWEEN clause: column BETWEEN low AND high
Sourcepub fn is_null(self) -> FilterExpr
pub fn is_null(self) -> FilterExpr
IS NULL: column IS NULL
Sourcepub fn is_not_null(self) -> FilterExpr
pub fn is_not_null(self) -> FilterExpr
IS NOT NULL: column IS NOT NULL
Source§impl<C> ColumnRef<C>
impl<C> ColumnRef<C>
Sourcepub fn like(self, pattern: String) -> FilterExpr
pub fn like(self, pattern: String) -> FilterExpr
LIKE pattern matching: column LIKE pattern
Sourcepub fn ilike(self, pattern: String) -> FilterExpr
pub fn ilike(self, pattern: String) -> FilterExpr
ILIKE case-insensitive: column ILIKE pattern
Sourcepub fn starts_with(self, prefix: &str) -> FilterExpr
pub fn starts_with(self, prefix: &str) -> FilterExpr
Starts with: column LIKE 'prefix%'
Sourcepub fn ends_with(self, suffix: &str) -> FilterExpr
pub fn ends_with(self, suffix: &str) -> FilterExpr
Ends with: column LIKE '%suffix'
Sourcepub fn contains(self, substr: &str) -> FilterExpr
pub fn contains(self, substr: &str) -> FilterExpr
Contains: column LIKE '%substr%'
Trait Implementations§
impl<C> Copy for ColumnRef<C>where
C: Column,
Auto Trait Implementations§
impl<C> Freeze for ColumnRef<C>
impl<C> RefUnwindSafe for ColumnRef<C>where
C: RefUnwindSafe,
impl<C> Send for ColumnRef<C>
impl<C> Sync for ColumnRef<C>
impl<C> Unpin for ColumnRef<C>where
C: Unpin,
impl<C> UnsafeUnpin for ColumnRef<C>
impl<C> UnwindSafe for ColumnRef<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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