NumericColumn

Struct NumericColumn 

Source
pub struct NumericColumn<E: EntityTrait>(pub E::Column);
Expand description

A column of numeric type, including integer, float and decimal

Tuple Fieldsยง

ยง0: E::Column

Implementationsยง

Sourceยง

impl<E: EntityTrait> NumericColumn<E>

Source

pub fn def(&self) -> ColumnDef

Get the column definition with SQL attributes

Source

pub fn enum_type_name(&self) -> Option<&'static str>

Get the enum type name if this is a enum column

Source

pub fn entity_name(&self) -> DynIden

Get the name of the entity the column belongs to

Source

pub fn as_column_ref(&self) -> (DynIden, DynIden)

Get the table.column reference

Source

pub fn eq<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn ne<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn gt<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn gte<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn lt<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn lte<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn add<T>(&self, expr: T) -> Expr
where T: Into<Expr>,

Source

pub fn sub<T>(&self, expr: T) -> Expr
where T: Into<Expr>,

Source

pub fn div<T>(&self, expr: T) -> Expr
where T: Into<Expr>,

Source

pub fn mul<T>(&self, expr: T) -> Expr
where T: Into<Expr>,

Source

pub fn between<V>(&self, v1: V, v2: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn not_between<V>(&self, v1: V, v2: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn max(&self) -> Expr

Source

pub fn min(&self) -> Expr

Source

pub fn sum(&self) -> Expr

Source

pub fn count(&self) -> Expr

Source

pub fn is_null(&self) -> Expr

Source

pub fn is_not_null(&self) -> Expr

Source

pub fn if_null<V>(&self, v: V) -> Expr
where V: Into<Value> + NumericValue,

Source

pub fn is_in<V, I>(&self, v: I) -> Expr
where V: Into<Value> + NumericValue, I: IntoIterator<Item = V>,

Source

pub fn is_not_in<V, I>(&self, v: I) -> Expr
where V: Into<Value> + NumericValue, I: IntoIterator<Item = V>,

Source

pub fn eq_any<V, I>(&self, v: I) -> Expr
where V: Into<Value> + NumericValue + ValueType + NotU8, I: IntoIterator<Item = V>,

Available on crate feature postgres-array only.

= ANY(..) operator. Postgres only.

Source

pub fn in_subquery(&self, s: SelectStatement) -> Expr

Source

pub fn not_in_subquery(&self, s: SelectStatement) -> Expr

Trait Implementationsยง

Sourceยง

impl<E: Clone + EntityTrait> Clone for NumericColumn<E>
where E::Column: Clone,

Sourceยง

fn clone(&self) -> NumericColumn<E>

Returns a duplicate of the value. Read more
1.0.0ยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<E: Debug + EntityTrait> Debug for NumericColumn<E>
where E::Column: Debug,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<E: Hash + EntityTrait> Hash for NumericColumn<E>
where E::Column: Hash,

Sourceยง

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0ยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Sourceยง

impl<E: EntityTrait> Iden for NumericColumn<E>

Sourceยง

fn quoted(&self) -> Cow<'static, str>

Return the to-be sanitized version of the identifier. Read more
Sourceยง

fn unquoted(&self) -> &str

Write a raw identifier string without quotes. Read more
Sourceยง

fn to_string(&self) -> String

A shortcut for writing an unquoted identifier into a String. Read more
Sourceยง

impl<E: EntityTrait> IntoSimpleExpr for NumericColumn<E>

Sourceยง

fn into_simple_expr(self) -> Expr

Method to perform the conversion
Sourceยง

impl<E: PartialEq + EntityTrait> PartialEq for NumericColumn<E>
where E::Column: PartialEq,

Sourceยง

fn eq(&self, other: &NumericColumn<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0ยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl<E: Copy + EntityTrait> Copy for NumericColumn<E>
where E::Column: Copy,

Sourceยง

impl<E: Eq + EntityTrait> Eq for NumericColumn<E>
where E::Column: Eq,

Sourceยง

impl<E: EntityTrait> StructuralPartialEq for NumericColumn<E>

Auto Trait Implementationsยง

ยง

impl<E> Freeze for NumericColumn<E>
where <E as EntityTrait>::Column: Freeze,

ยง

impl<E> RefUnwindSafe for NumericColumn<E>

ยง

impl<E> Send for NumericColumn<E>
where <E as EntityTrait>::Column: Send,

ยง

impl<E> Sync for NumericColumn<E>
where <E as EntityTrait>::Column: Sync,

ยง

impl<E> Unpin for NumericColumn<E>
where <E as EntityTrait>::Column: Unpin,

ยง

impl<E> UnwindSafe for NumericColumn<E>
where <E as EntityTrait>::Column: UnwindSafe,

Blanket Implementationsยง

ยง

impl<T> Any for T
where T: 'static + ?Sized,

ยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
ยง

impl<T> Borrow<T> for T
where T: ?Sized,

ยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
ยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

ยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
ยง

impl<T> CloneToUninit for T
where T: Clone,

ยง

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
ยง

impl<T> From<T> for T

ยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<I> IdenList for I
where I: IntoIden,

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
ยง

impl<T, U> Into<U> for T
where U: From<T>,

ยง

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> IntoColumnRef for T
where T: Into<ColumnRef>,

Sourceยง

impl<T> IntoEither for T

Sourceยง

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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Sourceยง

impl<T> IntoIden for T
where T: Into<DynIden>,

Sourceยง

impl<T> IntoIndexColumn for T
where T: Into<IndexColumn>,

Sourceยง

impl<T> IntoTableRef for T
where T: Into<TableRef>,

Sourceยง

impl<T> IntoTypeRef for T
where T: Into<TypeRef>,

Sourceยง

impl<T> MaybeQualifiedOnce for T
where T: IntoIden,

Sourceยง

fn into_2_parts(self) -> (Option<DynIden>, DynIden)

Represent a maybe-qualified name as a (foo?, bar) tuple.
Sourceยง

impl<T> MaybeQualifiedTwice for T

Sourceยง

fn into_3_parts(self) -> (Option<(Option<DynIden>, DynIden)>, DynIden)

Represent a maybe-qualified name as a (foo?, bar?, baz) tuple. Read more
ยง

impl<T> ToOwned for T
where T: Clone,

ยง

type Owned = T

The resulting type after obtaining ownership.
ยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
ยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
ยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

ยง

type Error = Infallible

The type returned in the event of a conversion error.
ยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
ยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

ยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
ยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more