pub enum DbValue {
Null,
Integer(i64),
Real(f64),
Text(String),
Blob(Vec<u8>),
Boolean(bool),
Date(i64),
Datetime(i64),
}Expand description
数据库值类型 - 支持 8 种基本类型
Variants§
Implementations§
Source§impl DbValue
impl DbValue
pub fn null() -> Self
pub fn integer(v: i64) -> Self
pub fn real(v: f64) -> Self
pub fn text(v: impl Into<String>) -> Self
pub fn blob(v: Vec<u8>) -> Self
pub fn boolean(v: bool) -> Self
pub fn date(v: i64) -> Self
pub fn datetime(v: i64) -> Self
pub fn as_integer(&self) -> Option<i64>
pub fn as_real(&self) -> Option<f64>
pub fn as_text(&self) -> Option<&str>
pub fn as_blob(&self) -> Option<&[u8]>
pub fn as_boolean(&self) -> Option<bool>
pub fn as_date(&self) -> Option<i64>
pub fn as_datetime(&self) -> Option<i64>
pub fn is_null(&self) -> bool
pub fn type_name(&self) -> &'static str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DbValue
impl<'de> Deserialize<'de> for DbValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for DbValue
impl Ord for DbValue
Source§impl PartialOrd for DbValue
impl PartialOrd for DbValue
impl Eq for DbValue
impl StructuralPartialEq for DbValue
Auto Trait Implementations§
impl Freeze for DbValue
impl RefUnwindSafe for DbValue
impl Send for DbValue
impl Sync for DbValue
impl Unpin for DbValue
impl UnsafeUnpin for DbValue
impl UnwindSafe for DbValue
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.