Struct Column

Source
pub struct Column<'a> {
    pub name: Cow<'a, str>,
    /* private fields */
}
Expand description

A column definition.

Fields§

§name: Cow<'a, str>

Implementations§

Source§

impl<'a> Column<'a>

Source

pub fn into_bare(self) -> Self

Create a bare version of the column, stripping out all other information other than the name.

Source§

impl<'a> Column<'a>

Source

pub fn new<S>(name: S) -> Self
where S: Into<Cow<'a, str>>,

Create a column definition.

Source

pub fn table<T>(self, table: T) -> Self
where T: Into<Table<'a>>,

Include the table name in the column expression.

Source

pub fn opt_table<T>(self, table: Option<T>) -> Self
where T: Into<Table<'a>>,

Include the table name in the column expression, if table is defined.

Trait Implementations§

Source§

impl<'a> Aliasable<'a> for Column<'a>

Source§

type Target = Column<'a>

Source§

fn alias<T>(self, alias: T) -> Self::Target
where T: Into<Cow<'a, str>>,

Alias table for usage elsewhere in the query.
Source§

impl<'a> Clone for Column<'a>

Source§

fn clone(&self) -> Column<'a>

Returns a copy 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<'a> Debug for Column<'a>

Source§

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

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

impl<'a> Default for Column<'a>

Source§

fn default() -> Column<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a, 'b> From<&'a &'b str> for Column<'b>

Source§

fn from(s: &'a &'b str) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for Column<'a>

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl<'a, T, C> From<(T, C)> for Column<'a>
where T: Into<Table<'a>>, C: Into<Column<'a>>,

Source§

fn from(t: (T, C)) -> Column<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Column<'a>> for Expression<'a>

Source§

fn from(col: Column<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Column<'a>> for JsonType<'a>

Source§

fn from(col: Column<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<String> for Column<'a>

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl<'a> Groupable<'a> for Column<'a>

Source§

fn group(self) -> GroupByDefinition<'a>

Group by self
Source§

impl<'a> IntoGroupByDefinition<'a> for Column<'a>

Source§

impl<'a> IntoOrderDefinition<'a> for Column<'a>

Source§

impl<'a> Orderable<'a> for Column<'a>

Source§

fn order(self, order: Option<Order>) -> OrderDefinition<'a>

Order by self in the given order
Source§

fn ascend(self) -> OrderDefinition<'a>

Change the order to ASC
Source§

fn descend(self) -> OrderDefinition<'a>

Change the order to DESC
Source§

fn ascend_nulls_first(self) -> OrderDefinition<'a>

Change the order to ASC NULLS FIRST
Source§

fn ascend_nulls_last(self) -> OrderDefinition<'a>

Change the order to ASC NULLS LAST
Source§

fn descend_nulls_first(self) -> OrderDefinition<'a>

Change the order to DESC NULLS FIRST
Source§

fn descend_nulls_last(self) -> OrderDefinition<'a>

Change the order to ASC NULLS LAST
Source§

impl<'a> PartialEq for Column<'a>

Defines a default value for a Column.

Source§

fn eq(&self, other: &Column<'_>) -> 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.

Auto Trait Implementations§

§

impl<'a> Freeze for Column<'a>

§

impl<'a> RefUnwindSafe for Column<'a>

§

impl<'a> Send for Column<'a>

§

impl<'a> Sync for Column<'a>

§

impl<'a> Unpin for Column<'a>

§

impl<'a> UnwindSafe for Column<'a>

Blanket Implementations§

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> 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<'a, U> Comparable<'a> for U
where U: Into<Column<'a>>,

Source§

fn equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if both sides are the same value.
Source§

fn not_equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if both sides are not the same value.
Source§

fn less_than<T>(self, comparison: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side is smaller than the right side.
Source§

fn less_than_or_equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side is smaller than the right side or the same.
Source§

fn greater_than<T>(self, comparison: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side is bigger than the right side.
Source§

fn greater_than_or_equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side is bigger than the right side or the same.
Source§

fn in_selection<T>(self, selection: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side is included in the right side collection.
Source§

fn not_in_selection<T>(self, selection: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side is not included in the right side collection.
Source§

fn like<T>(self, pattern: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side includes the right side string.
Source§

fn not_like<T>(self, pattern: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the left side does not include the right side string.
Source§

fn is_null(self) -> Compare<'a>

Tests if the left side is NULL.
Source§

fn is_not_null(self) -> Compare<'a>

Tests if the left side is not NULL.
Source§

fn between<T, V>(self, left: T, right: V) -> Compare<'a>
where T: Into<Expression<'a>>, V: Into<Expression<'a>>,

Tests if the value is between two given values.
Source§

fn not_between<T, V>(self, left: T, right: V) -> Compare<'a>
where T: Into<Expression<'a>>, V: Into<Expression<'a>>,

Tests if the value is not between two given values.
Source§

fn compare_raw<T, V>(self, raw_comparator: T, right: V) -> Compare<'a>
where T: Into<Cow<'a, str>>, V: Into<Expression<'a>>,

Compares two expressions with a custom operator.
Source§

fn array_overlaps<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the array overlaps with another array.
Source§

fn array_contains<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the array contains another array.
Source§

fn array_contained<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the JSON array contains a value.
Source§

fn json_array_not_contains<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the JSON array does not contain a value.
Source§

fn json_array_begins_with<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the JSON array starts with a value.
Source§

fn json_array_not_begins_with<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the JSON array does not start with a value.
Source§

fn json_array_ends_into<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the JSON array ends with a value.
Source§

fn json_array_not_ends_into<T>(self, item: T) -> Compare<'a>
where T: Into<Expression<'a>>,

Tests if the JSON array does not end with a value.
Source§

fn json_type_equals<T>(self, json_type: T) -> Compare<'a>
where T: Into<JsonType<'a>>,

Tests if the JSON value is of a certain type.
Source§

fn json_type_not_equals<T>(self, json_type: T) -> Compare<'a>
where T: Into<JsonType<'a>>,

Tests if the JSON value is not of a certain type.
Source§

fn any(self) -> Compare<'a>

Matches at least one elem of a list of values.
Source§

fn all(self) -> Compare<'a>

Matches all elem of a list of values.
Source§

impl<'a, T> Conjunctive<'a> for T
where T: Into<Expression<'a>>,

Source§

fn and<E>(self, other: E) -> ConditionTree<'a>
where E: Into<Expression<'a>>,

Builds an AND condition having self as the left leaf and other as the right.
Source§

fn or<E>(self, other: E) -> ConditionTree<'a>
where E: Into<Expression<'a>>,

Builds an OR condition having self as the left leaf and other as the right.
Source§

fn not(self) -> ConditionTree<'a>

Builds a NOT condition having self as the condition.
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<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.