pub enum Value {
Bool(Option<bool>),
Binary(Option<Vec<u8>>),
Short(Option<i16>),
Int(Option<i32>),
Long(Option<i64>),
Float(Option<f32>),
Double(Option<f64>),
Text(Option<String>),
ChronoDate(Option<NaiveDateTime>),
Array(Vec<Self>),
}
Variants§
Bool(Option<bool>)
Binary(Option<Vec<u8>>)
Short(Option<i16>)
Int(Option<i32>)
Long(Option<i64>)
Float(Option<f32>)
Double(Option<f64>)
Text(Option<String>)
ChronoDate(Option<NaiveDateTime>)
Array(Vec<Self>)
Implementations§
Source§impl Value
impl Value
pub fn len(&self) -> usize
pub fn add_param_value(&self, str: &mut String)
pub fn as_string(&self) -> String
pub fn bind_to_query<'a, DB: Database>(
&self,
query: Query<'a, DB, DB::Arguments<'a>>,
) -> Query<'a, DB, DB::Arguments<'a>>where
Option<bool>: Encode<'a, DB> + Decode<'a, DB>,
bool: Type<DB>,
Option<i16>: Encode<'a, DB> + Decode<'a, DB>,
i16: Type<DB>,
Option<i32>: Encode<'a, DB> + Decode<'a, DB>,
i32: Type<DB>,
Option<i64>: Encode<'a, DB> + Decode<'a, DB>,
i64: Type<DB>,
Option<f64>: Encode<'a, DB> + Decode<'a, DB>,
f64: Type<DB>,
Option<f32>: Encode<'a, DB> + Decode<'a, DB>,
f32: Type<DB>,
Option<NaiveDateTime>: Encode<'a, DB> + Decode<'a, DB>,
NaiveDateTime: Type<DB>,
Option<String>: Encode<'a, DB> + Decode<'a, DB>,
String: Type<DB>,
Option<Vec<u8>>: Encode<'a, DB> + Decode<'a, DB>,
Vec<u8>: Type<DB>,
pub fn bind_to_query_as<'a, O, DB: Database>(
&self,
query: QueryAs<'a, DB, O, DB::Arguments<'a>>,
) -> QueryAs<'a, DB, O, DB::Arguments<'a>>where
Option<bool>: Encode<'a, DB> + Decode<'a, DB>,
bool: Type<DB>,
Option<i16>: Encode<'a, DB> + Decode<'a, DB>,
i16: Type<DB>,
Option<i32>: Encode<'a, DB> + Decode<'a, DB>,
i32: Type<DB>,
Option<i64>: Encode<'a, DB> + Decode<'a, DB>,
i64: Type<DB>,
Option<f64>: Encode<'a, DB> + Decode<'a, DB>,
f64: Type<DB>,
Option<f32>: Encode<'a, DB> + Decode<'a, DB>,
f32: Type<DB>,
Option<NaiveDateTime>: Encode<'a, DB> + Decode<'a, DB>,
NaiveDateTime: Type<DB>,
Option<String>: Encode<'a, DB> + Decode<'a, DB>,
String: Type<DB>,
Option<Vec<u8>>: Encode<'a, DB> + Decode<'a, DB>,
Vec<u8>: Type<DB>,
pub fn bind_to_query_scalar<'a, O, DB: Database>(
&self,
query: QueryScalar<'a, DB, O, DB::Arguments<'a>>,
) -> QueryScalar<'a, DB, O, DB::Arguments<'a>>where
Option<bool>: Encode<'a, DB> + Decode<'a, DB>,
bool: Type<DB>,
Option<i16>: Encode<'a, DB> + Decode<'a, DB>,
i16: Type<DB>,
Option<i32>: Encode<'a, DB> + Decode<'a, DB>,
i32: Type<DB>,
Option<i64>: Encode<'a, DB> + Decode<'a, DB>,
i64: Type<DB>,
Option<f64>: Encode<'a, DB> + Decode<'a, DB>,
f64: Type<DB>,
Option<f32>: Encode<'a, DB> + Decode<'a, DB>,
f32: Type<DB>,
Option<NaiveDateTime>: Encode<'a, DB> + Decode<'a, DB>,
NaiveDateTime: Type<DB>,
Option<String>: Encode<'a, DB> + Decode<'a, DB>,
String: Type<DB>,
Option<Vec<u8>>: Encode<'a, DB> + Decode<'a, DB>,
Vec<u8>: Type<DB>,
Trait Implementations§
Source§impl From<&NaiveDateTime> for Value
impl From<&NaiveDateTime> for Value
Source§fn from(value: &NaiveDateTime) -> Self
fn from(value: &NaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl From<NaiveDateTime> for Value
impl From<NaiveDateTime> for Value
Source§fn from(value: NaiveDateTime) -> Self
fn from(value: NaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl From<Option<NaiveDateTime>> for Value
impl From<Option<NaiveDateTime>> for Value
Source§fn from(value: Option<NaiveDateTime>) -> Self
fn from(value: Option<NaiveDateTime>) -> Self
Converts to this type from the input type.
Source§impl From<Vec<NaiveDateTime>> for Value
impl From<Vec<NaiveDateTime>> for Value
Source§fn from(value: Vec<NaiveDateTime>) -> Self
fn from(value: Vec<NaiveDateTime>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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