pub enum ValueRef<'a> {
}
Expand description
A non-owning static type value. Typically the memory backing this value is owned by SQLite.
See Value
for an owning dynamic type value.
Variants
Null
The value is a NULL
value.
Boolean(bool)
The value is a boolean.
TinyInt(i8)
The value is a signed tiny integer.
SmallInt(i16)
The value is a signed small integer.
Int(i32)
The value is a signed integer.
BigInt(i64)
The value is a signed big integer.
HugeInt(i128)
The value is a signed huge integer.
UTinyInt(u8)
The value is a unsigned tiny integer.
USmallInt(u16)
The value is a usigned small integer.
UInt(u32)
The value is a usigned integer.
UBigInt(u64)
The value is a usigned big integer.
Float(f32)
The value is a f32.
Double(f64)
The value is a f64.
Decimal(Decimal)
The value is a decimal
Timestamp(TimeUnit, i64)
The value is a timestap.
Text(&'a [u8])
The value is a text string.
Blob(&'a [u8])
The value is a blob of data
Date32(i32)
The value is a date32
Time64(TimeUnit, i64)
The value is a time64
Implementations
sourceimpl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
sourcepub fn as_str(&self) -> FromSqlResult<&'a str>
pub fn as_str(&self) -> FromSqlResult<&'a str>
If self
is case Text
, returns the string value. Otherwise, returns
Err(Error::InvalidColumnType)
.
sourcepub fn as_blob(&self) -> FromSqlResult<&'a [u8]>
pub fn as_blob(&self) -> FromSqlResult<&'a [u8]>
If self
is case Blob
, returns the byte slice. Otherwise, returns
Err(Error::InvalidColumnType)
.
Trait Implementations
impl<'a> Copy for ValueRef<'a>
impl<'a> StructuralPartialEq for ValueRef<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ValueRef<'a>
impl<'a> Send for ValueRef<'a>
impl<'a> Sync for ValueRef<'a>
impl<'a> Unpin for ValueRef<'a>
impl<'a> UnwindSafe for ValueRef<'a>
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> 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