Enum rusqlite::types::ValueRef
[−]
[src]
pub enum ValueRef<'a> { Null, Integer(i64), Real(f64), Text(&'a str), Blob(&'a [u8]), }
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 str)
The value is a text string.
Blob(&'a [u8])
The value is a blob of data
Methods
impl<'a> ValueRef<'a>
[src]
impl<'a> ValueRef<'a>
[src]
pub fn as_i64(&self) -> FromSqlResult<i64>
[src]
If self
is case Integer
, returns the integral value. Otherwise, returns
Err(Error::InvalidColumnType)
.
pub fn as_f64(&self) -> FromSqlResult<f64>
[src]
If self
is case Real
, returns the floating point value. Otherwise, returns
Err(Error::InvalidColumnType)
.
pub fn as_str(&self) -> FromSqlResult<&str>
[src]
If self
is case Text
, returns the string value. Otherwise, returns
Err(Error::InvalidColumnType)
.
pub fn as_blob(&self) -> FromSqlResult<&[u8]>
[src]
If self
is case Blob
, returns the byte slice. Otherwise, returns
Err(Error::InvalidColumnType)
.
Trait Implementations
impl<'a> Copy for ValueRef<'a>
[src]
impl<'a> Clone for ValueRef<'a>
[src]
fn clone(&self) -> ValueRef<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Debug for ValueRef<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> PartialEq for ValueRef<'a>
[src]
fn eq(&self, __arg_0: &ValueRef<'a>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ValueRef<'a>) -> bool
[src]
This method tests for !=
.