pub struct Column<T: SurrealRecord, V: SurrealQL> {
pub name: &'static str,
pub surreal_type: &'static str,
/* private fields */
}Expand description
A typed reference to a record field — e.g. Post::title() yields a
Column<Post, String>. Generated by #[derive(SurrealRecord)] and used to
build type-checked filters (.eq(...), .gt(...), …) and projections.
Fields§
§name: &'static strThe database column name.
surreal_type: &'static strThe SurrealQL type name for this column.
Implementations§
Source§impl<T: SurrealRecord, V: SurrealQL> Column<T, V>
impl<T: SurrealRecord, V: SurrealQL> Column<T, V>
pub fn eq(&self, value: V) -> EqExpr
pub fn ne(&self, value: V) -> NeExpr
pub fn gt(&self, value: V) -> GtExpr
pub fn lt(&self, value: V) -> LtExpr
pub fn gte(&self, value: V) -> GteExpr
pub fn lte(&self, value: V) -> LteExpr
pub fn contains(&self, value: V) -> ContainsExpr
Sourcepub fn contains_expr(&self, expr: impl DynExpr + 'static) -> ContainsExpr
pub fn contains_expr(&self, expr: impl DynExpr + 'static) -> ContainsExpr
column CONTAINS <expr> — e.g. array-membership test with an expression.
Sourcepub fn eq_expr(&self, rhs: impl DynExpr + 'static) -> EqExpr
pub fn eq_expr(&self, rhs: impl DynExpr + 'static) -> EqExpr
Compare this column to an arbitrary expression — e.g. a RecordLink
(asset = type::record('asset', …)) or NoneLit (tenant = NONE).
pub fn ne_expr(&self, rhs: impl DynExpr + 'static) -> NeExpr
Sourcepub fn in_expr(&self, rhs: impl DynExpr + 'static) -> InExpr
pub fn in_expr(&self, rhs: impl DynExpr + 'static) -> InExpr
column IN <expr> — e.g. an array literal or a parenthesized subquery.
Sourcepub fn not_in_expr(&self, rhs: impl DynExpr + 'static) -> NotInExpr
pub fn not_in_expr(&self, rhs: impl DynExpr + 'static) -> NotInExpr
column NOT IN <expr>.
Trait Implementations§
impl<T: SurrealRecord, V: SurrealQL> Copy for Column<T, V>
Source§impl<T: SurrealRecord, V: SurrealQL> DynExpr for Column<T, V>
impl<T: SurrealRecord, V: SurrealQL> DynExpr for Column<T, V>
Source§fn render_dyn(&self, buf: &mut String)
fn render_dyn(&self, buf: &mut String)
Append this expression’s SurrealQL to
buf with all values inlined.Auto Trait Implementations§
impl<T, V> Freeze for Column<T, V>
impl<T, V> RefUnwindSafe for Column<T, V>where
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<T, V> Send for Column<T, V>
impl<T, V> Sync for Column<T, V>
impl<T, V> Unpin for Column<T, V>
impl<T, V> UnsafeUnpin for Column<T, V>
impl<T, V> UnwindSafe for Column<T, V>where
T: UnwindSafe,
V: 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
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,
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