rust_query

Struct Column

Source
pub struct Column<'t, S, T>(/* private fields */);
Expand description

Values of this type reference a collumn in a query.

  • The lifetime parameter 't specifies in which query the collumn exists.
  • The type parameter S specifies the expected schema of the query.
  • And finally the type paramter T specifies the type of the column.

Column implements Deref to have table extension methods in case the type is a table type.

Implementations§

Source§

impl<'t, S, T: NumTyp> Column<'t, S, T>

Source

pub fn add(&self, rhs: impl IntoColumn<'t, S, Typ = T>) -> Column<'t, S, T>

Add two columns together.

Source

pub fn lt(&self, rhs: impl IntoColumn<'t, S, Typ = T>) -> Column<'t, S, bool>

Compute the less than operator of two columns.

Source§

impl<'t, S, T: EqTyp + 't> Column<'t, S, T>

Source

pub fn eq(&self, rhs: impl IntoColumn<'t, S, Typ = T>) -> Column<'t, S, bool>

Check whether two columns are equal.

Source§

impl<'t, S> Column<'t, S, bool>

Source

pub fn not(&self) -> Column<'t, S, bool>

Checks whether a column is false.

Source

pub fn and( &self, rhs: impl IntoColumn<'t, S, Typ = bool>, ) -> Column<'t, S, bool>

Check if two columns are both true.

Source

pub fn or(&self, rhs: impl IntoColumn<'t, S, Typ = bool>) -> Column<'t, S, bool>

Check if one of two columns is true.

Source§

impl<'t, S, Typ: 't> Column<'t, S, Option<Typ>>

Source

pub fn unwrap_or( &self, rhs: impl IntoColumn<'t, S, Typ = Typ>, ) -> Column<'t, S, Typ>
where Self: IntoColumn<'t, S, Typ = Option<Typ>>,

Use the first column if it is Some, otherwise use the second column.

Source

pub fn is_some(&self) -> Column<'t, S, bool>

Check that the column is Some.

Source§

impl<'t, S> Column<'t, S, i64>

Source

pub fn as_float(&self) -> Column<'t, S, f64>

Convert the i64 column to f64 type.

Trait Implementations§

Source§

impl<'t, S, T> Clone for Column<'t, S, T>

Source§

fn clone(&self) -> Self

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<'t, S, T: Table> Deref for Column<'t, S, T>

Source§

type Target = <T as Table>::Ext<Column<'t, S, T>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'t, S: 't, T: 't> IntoColumn<'t, S> for Column<'t, S, T>

Source§

fn into_column(self) -> Column<'t, S, Self::Typ>

Turn this value into a Column.

Auto Trait Implementations§

§

impl<'t, S, T> Freeze for Column<'t, S, T>

§

impl<'t, S, T> !RefUnwindSafe for Column<'t, S, T>

§

impl<'t, S, T> !Send for Column<'t, S, T>

§

impl<'t, S, T> !Sync for Column<'t, S, T>

§

impl<'t, S, T> Unpin for Column<'t, S, T>

§

impl<'t, S, T> !UnwindSafe for Column<'t, S, T>

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<'t, 'a, S, T> Dummy<'t, 'a, S> for T
where T: IntoColumn<'t, S>, <T as Typed>::Typ: MyTyp,

Source§

type Out = <<T as Typed>::Typ as MyTyp>::Out<'a>

The type that results from querying this dummy.
Source§

fn prepare(self, cacher: Cacher<'_, 't, S>) -> impl FnMut(Row<'_, 't, 'a>) + 't

Source§

fn map_dummy<T>( self, f: impl FnMut(Self::Out) -> T + 't, ) -> impl Dummy<'t, 'a, S, Out = T>

Map a dummy to another dummy using native rust. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V