pub struct Literal<T>where
T: Clone,{ /* private fields */ }Expand description
字面量表达式
将 Rust 值包装为 SQL 字面量(参数化)。
SqlType 由值类型派生:i64→BigInt、i32→Integer、String→Text、
bool→Bool、f64→Double、f32→Real、Vec<u8>→Binary。
其他类型需显式实现 TypedExpression。
Implementations§
Trait Implementations§
Source§impl TypedExpression for Literal<i64>
Literal<i64> → SQL BigInt 类型
impl TypedExpression for Literal<i64>
Literal<i64> → SQL BigInt 类型
Source§impl TypedExpression for Literal<i32>
Literal<i32> → SQL Integer 类型
impl TypedExpression for Literal<i32>
Literal<i32> → SQL Integer 类型
Source§impl TypedExpression for Literal<i16>
Literal<i16> → SQL SmallInt 类型
impl TypedExpression for Literal<i16>
Literal<i16> → SQL SmallInt 类型
Source§impl TypedExpression for Literal<i8>
Literal<i8> → SQL SmallInt 类型
impl TypedExpression for Literal<i8>
Literal<i8> → SQL SmallInt 类型
Source§impl TypedExpression for Literal<f64>
Literal<f64> → SQL Double 类型
impl TypedExpression for Literal<f64>
Literal<f64> → SQL Double 类型
Source§impl TypedExpression for Literal<f32>
Literal<f32> → SQL Real 类型
impl TypedExpression for Literal<f32>
Literal<f32> → SQL Real 类型
Source§impl TypedExpression for Literal<String>
Literal<String> → SQL Text 类型
impl TypedExpression for Literal<String>
Literal<String> → SQL Text 类型
Source§impl TypedExpression for Literal<bool>
Literal<bool> → SQL Bool 类型
impl TypedExpression for Literal<bool>
Literal<bool> → SQL Bool 类型
Auto Trait Implementations§
impl<T> Freeze for Literal<T>where
T: Freeze,
impl<T> RefUnwindSafe for Literal<T>where
T: RefUnwindSafe,
impl<T> Send for Literal<T>where
T: Send,
impl<T> Sync for Literal<T>where
T: Sync,
impl<T> Unpin for Literal<T>where
T: Unpin,
impl<T> UnsafeUnpin for Literal<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Literal<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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