Expand description
A non-owning dynamic 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.
Integer(i64)
The value is a signed integer.
Real(f64)
The value is a floating point number.
Text(&'a [u8])
The value is a text string.
Blob(&'a [u8])
The value is a blob of data
Implementations
sourceimpl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
sourcepub fn as_i64(&self) -> Result<i64, FromSqlError>
pub fn as_i64(&self) -> Result<i64, FromSqlError>
If self
is case Integer
, returns the integral value. Otherwise,
returns Err(Error::InvalidColumnType)
.
sourcepub fn as_f64(&self) -> Result<f64, FromSqlError>
pub fn as_f64(&self) -> Result<f64, FromSqlError>
If self
is case Real
, returns the floating point value. Otherwise,
returns Err(Error::InvalidColumnType)
.
sourcepub fn as_str(&self) -> Result<&'a str, FromSqlError>
pub fn as_str(&self) -> Result<&'a str, FromSqlError>
If self
is case Text
, returns the string value. 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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more