pub enum Value {
Null,
Int(i64),
Float(f64),
Str(String),
Bool(bool),
DateTime(DateTime<Utc>),
Decimal(Decimal),
}Expand description
A single typed database value.
Variants§
Null
SQL NULL.
Int(i64)
Signed 64-bit integer.
Float(f64)
Double-precision float.
Str(String)
UTF-8 string.
Bool(bool)
Boolean.
DateTime(DateTime<Utc>)
UTC timestamp.
Decimal(Decimal)
Exact decimal.
Implementations§
Source§impl Value
impl Value
Sourcepub fn str(s: impl Into<String>) -> Self
pub fn str(s: impl Into<String>) -> Self
Shorthand for Value::Str from anything Into<String>.
Sourcepub fn int(v: i64) -> Self
pub fn int(v: i64) -> Self
Shorthand for Value::Int.
Sourcepub fn float(v: f64) -> Self
pub fn float(v: f64) -> Self
Shorthand for Value::Float.
Sourcepub fn bool(v: bool) -> Self
pub fn bool(v: bool) -> Self
Shorthand for Value::Bool.
Sourcepub fn datetime(at: DateTime<Utc>) -> Self
pub fn datetime(at: DateTime<Utc>) -> Self
Shorthand for Value::DateTime.
Sourcepub fn decimal(v: Decimal) -> Self
pub fn decimal(v: Decimal) -> Self
Shorthand for Value::Decimal.
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Forget for Value
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin 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