pub struct Nullable<ST: NotNull>(_);
Expand description
The nullable SQL type.
This wraps another SQL type to indicate that it can be null.
By default all values are assumed to be NOT NULL
.
ToSql
impls
- Any
T
which implementsToSql<ST>
Option<T>
for anyT
which implementsToSql<ST>
FromSql
impls
Option<T>
for anyT
which implementsFromSql<ST>
Trait Implementations
sourceimpl<'expr> AsExpression<Nullable<BigInt>> for &'expr i64
impl<'expr> AsExpression<Nullable<BigInt>> for &'expr i64
type Expression = Bound<Nullable<BigInt>, Self>
type Expression = Bound<Nullable<BigInt>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<BigInt>> for &'expr2 &'expr i64
impl<'expr2, 'expr> AsExpression<Nullable<BigInt>> for &'expr2 &'expr i64
type Expression = Bound<Nullable<BigInt>, Self>
type Expression = Bound<Nullable<BigInt>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<BigInt>> for i64
impl AsExpression<Nullable<BigInt>> for i64
type Expression = Bound<Nullable<BigInt>, Self>
type Expression = Bound<Nullable<BigInt>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Binary>> for &'expr Vec<u8>
impl<'expr> AsExpression<Nullable<Binary>> for &'expr Vec<u8>
type Expression = Bound<Nullable<Binary>, Self>
type Expression = Bound<Nullable<Binary>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Binary>> for &'expr2 &'expr Vec<u8>
impl<'expr2, 'expr> AsExpression<Nullable<Binary>> for &'expr2 &'expr Vec<u8>
type Expression = Bound<Nullable<Binary>, Self>
type Expression = Bound<Nullable<Binary>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Binary>> for Vec<u8>
impl AsExpression<Nullable<Binary>> for Vec<u8>
type Expression = Bound<Nullable<Binary>, Self>
type Expression = Bound<Nullable<Binary>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Binary>> for &'expr [u8]
impl<'expr> AsExpression<Nullable<Binary>> for &'expr [u8]
type Expression = Bound<Nullable<Binary>, Self>
type Expression = Bound<Nullable<Binary>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Binary>> for &'expr2 &'expr [u8]
impl<'expr2, 'expr> AsExpression<Nullable<Binary>> for &'expr2 &'expr [u8]
type Expression = Bound<Nullable<Binary>, Self>
type Expression = Bound<Nullable<Binary>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Bool>> for &'expr bool
impl<'expr> AsExpression<Nullable<Bool>> for &'expr bool
type Expression = Bound<Nullable<Bool>, Self>
type Expression = Bound<Nullable<Bool>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Bool>> for &'expr2 &'expr bool
impl<'expr2, 'expr> AsExpression<Nullable<Bool>> for &'expr2 &'expr bool
type Expression = Bound<Nullable<Bool>, Self>
type Expression = Bound<Nullable<Bool>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Bool>> for bool
impl AsExpression<Nullable<Bool>> for bool
type Expression = Bound<Nullable<Bool>, Self>
type Expression = Bound<Nullable<Bool>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Double>> for &'expr f64
impl<'expr> AsExpression<Nullable<Double>> for &'expr f64
type Expression = Bound<Nullable<Double>, Self>
type Expression = Bound<Nullable<Double>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Double>> for &'expr2 &'expr f64
impl<'expr2, 'expr> AsExpression<Nullable<Double>> for &'expr2 &'expr f64
type Expression = Bound<Nullable<Double>, Self>
type Expression = Bound<Nullable<Double>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Double>> for f64
impl AsExpression<Nullable<Double>> for f64
type Expression = Bound<Nullable<Double>, Self>
type Expression = Bound<Nullable<Double>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Float>> for &'expr f32
impl<'expr> AsExpression<Nullable<Float>> for &'expr f32
type Expression = Bound<Nullable<Float>, Self>
type Expression = Bound<Nullable<Float>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Float>> for &'expr2 &'expr f32
impl<'expr2, 'expr> AsExpression<Nullable<Float>> for &'expr2 &'expr f32
type Expression = Bound<Nullable<Float>, Self>
type Expression = Bound<Nullable<Float>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Float>> for f32
impl AsExpression<Nullable<Float>> for f32
type Expression = Bound<Nullable<Float>, Self>
type Expression = Bound<Nullable<Float>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Integer>> for &'expr i32
impl<'expr> AsExpression<Nullable<Integer>> for &'expr i32
type Expression = Bound<Nullable<Integer>, Self>
type Expression = Bound<Nullable<Integer>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Integer>> for &'expr2 &'expr i32
impl<'expr2, 'expr> AsExpression<Nullable<Integer>> for &'expr2 &'expr i32
type Expression = Bound<Nullable<Integer>, Self>
type Expression = Bound<Nullable<Integer>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Integer>> for i32
impl AsExpression<Nullable<Integer>> for i32
type Expression = Bound<Nullable<Integer>, Self>
type Expression = Bound<Nullable<Integer>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<T, ST> AsExpression<Nullable<ST>> for Option<T> where
ST: NotNull,
impl<T, ST> AsExpression<Nullable<ST>> for Option<T> where
ST: NotNull,
type Expression = Bound<Nullable<ST>, Self>
type Expression = Bound<Nullable<ST>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'a, T, ST> AsExpression<Nullable<ST>> for &'a Option<T> where
ST: NotNull,
impl<'a, T, ST> AsExpression<Nullable<ST>> for &'a Option<T> where
ST: NotNull,
type Expression = Bound<Nullable<ST>, Self>
type Expression = Bound<Nullable<ST>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<SmallInt>> for &'expr i16
impl<'expr> AsExpression<Nullable<SmallInt>> for &'expr i16
type Expression = Bound<Nullable<SmallInt>, Self>
type Expression = Bound<Nullable<SmallInt>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<SmallInt>> for &'expr2 &'expr i16
impl<'expr2, 'expr> AsExpression<Nullable<SmallInt>> for &'expr2 &'expr i16
type Expression = Bound<Nullable<SmallInt>, Self>
type Expression = Bound<Nullable<SmallInt>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<SmallInt>> for i16
impl AsExpression<Nullable<SmallInt>> for i16
type Expression = Bound<Nullable<SmallInt>, Self>
type Expression = Bound<Nullable<SmallInt>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Text>> for &'expr String
impl<'expr> AsExpression<Nullable<Text>> for &'expr String
type Expression = Bound<Nullable<Text>, Self>
type Expression = Bound<Nullable<Text>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Text>> for &'expr2 &'expr String
impl<'expr2, 'expr> AsExpression<Nullable<Text>> for &'expr2 &'expr String
type Expression = Bound<Nullable<Text>, Self>
type Expression = Bound<Nullable<Text>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Text>> for String
impl AsExpression<Nullable<Text>> for String
type Expression = Bound<Nullable<Text>, Self>
type Expression = Bound<Nullable<Text>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Text>> for &'expr str
impl<'expr> AsExpression<Nullable<Text>> for &'expr str
type Expression = Bound<Nullable<Text>, Self>
type Expression = Bound<Nullable<Text>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Text>> for &'expr2 &'expr str
impl<'expr2, 'expr> AsExpression<Nullable<Text>> for &'expr2 &'expr str
type Expression = Bound<Nullable<Text>, Self>
type Expression = Bound<Nullable<Text>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Timestamp>> for now
impl AsExpression<Nullable<Timestamp>> for now
type Expression = Coerce<now, Nullable<Timestamp>>
type Expression = Coerce<now, Nullable<Timestamp>>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr> AsExpression<Nullable<Timestamp>> for &'expr SystemTime
impl<'expr> AsExpression<Nullable<Timestamp>> for &'expr SystemTime
type Expression = Bound<Nullable<Timestamp>, Self>
type Expression = Bound<Nullable<Timestamp>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<'expr2, 'expr> AsExpression<Nullable<Timestamp>> for &'expr2 &'expr SystemTime
impl<'expr2, 'expr> AsExpression<Nullable<Timestamp>> for &'expr2 &'expr SystemTime
type Expression = Bound<Nullable<Timestamp>, Self>
type Expression = Bound<Nullable<Timestamp>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl AsExpression<Nullable<Timestamp>> for SystemTime
impl AsExpression<Nullable<Timestamp>> for SystemTime
type Expression = Bound<Nullable<Timestamp>, Self>
type Expression = Bound<Nullable<Timestamp>, Self>
The expression being returned
sourcefn as_expression(self) -> Self::Expression
fn as_expression(self) -> Self::Expression
Perform the conversion
sourceimpl<T, ST, DB> FromSql<Nullable<ST>, DB> for Option<T> where
T: FromSql<ST, DB>,
DB: Backend,
ST: NotNull,
impl<T, ST, DB> FromSql<Nullable<ST>, DB> for Option<T> where
T: FromSql<ST, DB>,
DB: Backend,
ST: NotNull,
sourceimpl<T, ST, DB> FromSqlRow<Nullable<ST>, DB> for Option<T> where
T: FromSqlRow<ST, DB>,
DB: Backend,
ST: NotNull,
impl<T, ST, DB> FromSqlRow<Nullable<ST>, DB> for Option<T> where
T: FromSqlRow<ST, DB>,
DB: Backend,
ST: NotNull,
sourceconst FIELDS_NEEDED: usize
const FIELDS_NEEDED: usize
The number of fields that this type will consume. Must be equal to
the number of times you would call row.take()
in build_from_row
Read more
sourcefn build_from_row<R: Row<DB>>(row: &mut R) -> Result<Self>
fn build_from_row<R: Row<DB>>(row: &mut R) -> Result<Self>
See the trait documentation.
sourceimpl<T, DB> HasSqlType<Nullable<T>> for DB where
DB: Backend + HasSqlType<T>,
T: NotNull,
impl<T, DB> HasSqlType<Nullable<T>> for DB where
DB: Backend + HasSqlType<T>,
T: NotNull,
sourcefn metadata(lookup: &DB::MetadataLookup) -> DB::TypeMetadata
fn metadata(lookup: &DB::MetadataLookup) -> DB::TypeMetadata
Fetch the metadata for the given type Read more
sourceimpl<T: NotNull> IntoNullable for Nullable<T>
impl<T: NotNull> IntoNullable for Nullable<T>
sourceimpl<T> QueryId for Nullable<T> where
T: QueryId + NotNull,
impl<T> QueryId for Nullable<T> where
T: QueryId + NotNull,
sourceconst HAS_STATIC_QUERY_ID: bool
const HAS_STATIC_QUERY_ID: bool
Can the SQL generated by Self
be uniquely identified by its type? Read more
sourceimpl<T, ST, DB> Queryable<Nullable<ST>, DB> for Option<T> where
T: Queryable<ST, DB>,
DB: Backend,
Option<T::Row>: FromSqlRow<Nullable<ST>, DB>,
ST: NotNull,
impl<T, ST, DB> Queryable<Nullable<ST>, DB> for Option<T> where
T: Queryable<ST, DB>,
DB: Backend,
Option<T::Row>: FromSqlRow<Nullable<ST>, DB>,
ST: NotNull,
sourceimpl<__DB> ToSql<Nullable<BigInt>, __DB> for i64 where
__DB: Backend,
Self: ToSql<BigInt, __DB>,
impl<__DB> ToSql<Nullable<BigInt>, __DB> for i64 where
__DB: Backend,
Self: ToSql<BigInt, __DB>,
sourceimpl<__DB> ToSql<Nullable<Binary>, __DB> for Vec<u8> where
__DB: Backend,
Self: ToSql<Binary, __DB>,
impl<__DB> ToSql<Nullable<Binary>, __DB> for Vec<u8> where
__DB: Backend,
Self: ToSql<Binary, __DB>,
sourceimpl<__DB> ToSql<Nullable<Binary>, __DB> for [u8] where
__DB: Backend,
Self: ToSql<Binary, __DB>,
impl<__DB> ToSql<Nullable<Binary>, __DB> for [u8] where
__DB: Backend,
Self: ToSql<Binary, __DB>,
sourceimpl<__DB> ToSql<Nullable<Double>, __DB> for f64 where
__DB: Backend,
Self: ToSql<Double, __DB>,
impl<__DB> ToSql<Nullable<Double>, __DB> for f64 where
__DB: Backend,
Self: ToSql<Double, __DB>,
sourceimpl<__DB> ToSql<Nullable<Float>, __DB> for f32 where
__DB: Backend,
Self: ToSql<Float, __DB>,
impl<__DB> ToSql<Nullable<Float>, __DB> for f32 where
__DB: Backend,
Self: ToSql<Float, __DB>,
sourceimpl<__DB> ToSql<Nullable<Integer>, __DB> for i32 where
__DB: Backend,
Self: ToSql<Integer, __DB>,
impl<__DB> ToSql<Nullable<Integer>, __DB> for i32 where
__DB: Backend,
Self: ToSql<Integer, __DB>,
sourceimpl<T, ST, DB> ToSql<Nullable<ST>, DB> for Option<T> where
T: ToSql<ST, DB>,
DB: Backend,
ST: NotNull,
impl<T, ST, DB> ToSql<Nullable<ST>, DB> for Option<T> where
T: ToSql<ST, DB>,
DB: Backend,
ST: NotNull,
sourceimpl<__DB> ToSql<Nullable<SmallInt>, __DB> for i16 where
__DB: Backend,
Self: ToSql<SmallInt, __DB>,
impl<__DB> ToSql<Nullable<SmallInt>, __DB> for i16 where
__DB: Backend,
Self: ToSql<SmallInt, __DB>,
sourceimpl<__DB> ToSql<Nullable<Text>, __DB> for String where
__DB: Backend,
Self: ToSql<Text, __DB>,
impl<__DB> ToSql<Nullable<Text>, __DB> for String where
__DB: Backend,
Self: ToSql<Text, __DB>,
sourceimpl<__DB> ToSql<Nullable<Timestamp>, __DB> for SystemTime where
__DB: Backend,
Self: ToSql<Timestamp, __DB>,
impl<__DB> ToSql<Nullable<Timestamp>, __DB> for SystemTime where
__DB: Backend,
Self: ToSql<Timestamp, __DB>,
impl<ST: Copy + NotNull> Copy for Nullable<ST>
impl<T: NotNull + SingleValue> SingleValue for Nullable<T>
impl<T: SqlOrd + NotNull> SqlOrd for Nullable<T>
Auto Trait Implementations
impl<ST> RefUnwindSafe for Nullable<ST> where
ST: RefUnwindSafe,
impl<ST> Send for Nullable<ST> where
ST: Send,
impl<ST> Sync for Nullable<ST> where
ST: Sync,
impl<ST> Unpin for Nullable<ST> where
ST: Unpin,
impl<ST> UnwindSafe for Nullable<ST> where
ST: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more