Column

Struct Column 

Source
pub struct Column<T, U, ST> { /* private fields */ }
Expand description

A database table column. A database table column. This type is created by the column function.

Implementations§

Source§

impl<T, U, ST> Column<T, U, ST>

Source

pub fn table(&self) -> &T

Gets a reference to the table of the column.

Source

pub fn name(&self) -> &U

Gets the name of the column, as provided on creation.

Trait Implementations§

Source§

impl<T: Clone, U: Clone, ST: Clone> Clone for Column<T, U, ST>

Source§

fn clone(&self) -> Column<T, U, ST>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, U: Debug, ST: Debug> Debug for Column<T, U, ST>

Source§

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

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

impl<T, U, ST> Expression for Column<T, U, ST>

Source§

type SqlType = ST

The type that this expression represents in SQL
Source§

impl<T: Hash, U: Hash, ST: Hash> Hash for Column<T, U, ST>

Source§

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

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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<T: PartialEq, U: PartialEq, ST: PartialEq> PartialEq for Column<T, U, ST>

Source§

fn eq(&self, other: &Column<T, U, ST>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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<T, U, ST, DB> QueryFragment<DB> for Column<T, U, ST>
where DB: Backend, T: QueryFragment<DB>, U: Borrow<str>,

Source§

fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, DB>) -> QueryResult<()>

Walk over this QueryFragment for all passes. Read more
Source§

fn to_sql( &self, out: &mut <DB as Backend>::QueryBuilder, backend: &DB, ) -> Result<(), Error>

Converts this QueryFragment to its SQL representation. Read more
Source§

fn collect_binds<'b>( &'b self, out: &mut <DB as Backend>::BindCollector<'b>, metadata_lookup: &mut <DB as TypeMetadata>::MetadataLookup, backend: &'b DB, ) -> Result<(), Error>

Serializes all bind parameters in this query. Read more
Source§

fn is_safe_to_cache_prepared(&self, backend: &DB) -> Result<bool, Error>

Is this query safe to store in the prepared statement cache? Read more
Source§

fn is_noop(&self, backend: &DB) -> Result<bool, Error>

Does walking this AST have any effect?
Source§

impl<T, U, ST> QueryId for Column<T, U, ST>

Source§

const HAS_STATIC_QUERY_ID: bool = false

Can the SQL generated by Self be uniquely identified by its type? Read more
Source§

type QueryId = ()

A type which uniquely represents Self in a SQL query. Read more
Source§

fn query_id() -> Option<TypeId>

Returns the type id of Self::QueryId if Self::HAS_STATIC_QUERY_ID. Returns None otherwise. Read more
Source§

impl<T, U, ST> ValidGrouping<()> for Column<T, U, ST>

Source§

type IsAggregate = No

Is this expression aggregate? Read more
Source§

impl<T, U, ST, QS> AppearsOnTable<QS> for Column<T, U, ST>
where Self: Expression,

Source§

impl<T: Copy, U: Copy, ST: Copy> Copy for Column<T, U, ST>

Source§

impl<T: Eq, U: Eq, ST: Eq> Eq for Column<T, U, ST>

Source§

impl<T, U, ST, QS> SelectableExpression<QS> for Column<T, U, ST>
where Self: Expression,

Source§

impl<T, U, ST> StructuralPartialEq for Column<T, U, ST>

Auto Trait Implementations§

§

impl<T, U, ST> Freeze for Column<T, U, ST>
where T: Freeze, U: Freeze,

§

impl<T, U, ST> RefUnwindSafe for Column<T, U, ST>

§

impl<T, U, ST> Send for Column<T, U, ST>
where T: Send, U: Send, ST: Send,

§

impl<T, U, ST> Sync for Column<T, U, ST>
where T: Sync, U: Sync, ST: Sync,

§

impl<T, U, ST> Unpin for Column<T, U, ST>
where T: Unpin, U: Unpin, ST: Unpin,

§

impl<T, U, ST> UnwindSafe for Column<T, U, ST>
where T: UnwindSafe, U: UnwindSafe, ST: UnwindSafe,

Blanket Implementations§

Source§

impl<T> AggregateExpressionMethods for T

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
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, ST> AsExpression<ST> for T
where T: Expression<SqlType = ST>, ST: SqlType + TypedExpressionType,

Source§

type Expression = T

The expression being returned
Source§

fn as_expression(self) -> T

Perform the conversion
Source§

impl<T, ST> AsExpressionList<ST> for T

Source§

type Expression = <T as IntoArrayExpression<ST>>::ArrayExpression

👎Deprecated: Use IntoArrayExpression instead
The final output expression
Source§

fn as_expression_list(self) -> <T as AsExpressionList<ST>>::Expression

👎Deprecated: Use IntoArrayExpression instead
Perform the conversion
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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Conn, DB, T> ExecuteDsl<Conn, DB> for T
where Conn: Connection<Backend = DB>, DB: Backend, T: QueryFragment<DB> + QueryId,

Source§

fn execute(query: T, conn: &mut Conn) -> Result<usize, Error>

Execute this command
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<ST, T> IntoArrayExpression<ST> for T
where T: AsExpression<Array<ST>>, ST: SqlType + TypedExpressionType + 'static,

Source§

type ArrayExpression = <T as AsExpression<Array<ST>>>::Expression

Type of the expression returned by IntoArrayExpression::into_array_expression
Source§

fn into_array_expression( self, ) -> <T as IntoArrayExpression<ST>>::ArrayExpression

Construct the diesel query dsl representation of the ARRAY (values) clause for the given type
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> NullableExpressionMethods for T
where T: Expression,

Source§

fn nullable(self) -> Nullable<Self>

Converts this potentially non-null expression into one which is treated as nullable. This method has no impact on the generated SQL, and is only used to allow certain comparisons that would otherwise fail to compile. Read more
Source§

fn assume_not_null(self) -> AssumeNotNull<Self>

Converts this potentially nullable expression into one which will be assumed to be not-null. This method has no impact on the generated SQL, however it will enable you to attempt deserialization of the returned value in a non-Option. Read more
Source§

impl<T> PgExpressionMethods for T
where T: Expression,

Source§

fn is_not_distinct_from<T>( self, other: T, ) -> Grouped<IsNotDistinctFrom<Self, <T as AsExpression<Self::SqlType>>::Expression>>
where Self::SqlType: SqlType, T: AsExpression<Self::SqlType>,

Creates a PostgreSQL IS NOT DISTINCT FROM expression. Read more
Source§

fn is_distinct_from<T>( self, other: T, ) -> Grouped<IsDistinctFrom<Self, <T as AsExpression<Self::SqlType>>::Expression>>
where Self::SqlType: SqlType, T: AsExpression<Self::SqlType>,

Creates a PostgreSQL IS DISTINCT FROM expression. Read more
Source§

fn is_contained_by_range<T>( self, other: T, ) -> Grouped<IsContainedBy<Self, <T as AsExpression<Range<Self::SqlType>>>::Expression>>
where Self::SqlType: SqlType, T: AsExpression<Range<Self::SqlType>>,

Creates a PostgreSQL <@ expression. Read more
Source§

impl<T, DB> QueryFragmentForCachedStatement<DB> for T
where DB: Backend, <DB as Backend>::QueryBuilder: Default, T: QueryFragment<DB>,

Source§

fn construct_sql(&self, backend: &DB) -> Result<String, Error>

Convert the query fragment into a SQL string for the given backend
Source§

fn is_safe_to_cache_prepared(&self, backend: &DB) -> Result<bool, Error>

Check whether it’s safe to cache the query
Source§

impl<T> SqliteExpressionMethods for T
where T: Expression,

Source§

fn is<T>( self, other: T, ) -> Grouped<Is<Self, <T as AsExpression<Self::SqlType>>::Expression>>
where Self::SqlType: SqlType, T: AsExpression<Self::SqlType>,

Creates a Sqlite IS expression. Read more
Source§

fn is_not<T>( self, other: T, ) -> Grouped<IsNot<Self, <T as AsExpression<Self::SqlType>>::Expression>>
where Self::SqlType: SqlType, T: AsExpression<Self::SqlType>,

Creates a Sqlite IS NOT expression. Read more
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 = Infallible

The type returned in the event of a conversion error.
Source§

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

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.
Source§

impl<T> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,