pub trait FromValue {
    fn value_type(&self) -> ValueType;
    fn get_i32(&self) -> i32;
    fn get_i64(&self) -> i64;
    fn get_f64(&self) -> f64;
    unsafe fn get_blob_unchecked(&self) -> &[u8] ;
    fn get_blob(&mut self) -> Result<&[u8]>;

    fn is_null(&self) -> bool { ... }
    fn try_get_blob(&self) -> Result<&[u8]> { ... }
    unsafe fn get_str_unchecked(&self) -> Result<&str> { ... }
    fn get_str(&mut self) -> Result<&str> { ... }
    fn try_get_str(&self) -> Result<&str> { ... }
    fn to_owned(&self) -> Result<Value> { ... }
}
Expand description

Allows access to an underlying SQLite value.

Required Methods§

Returns the data type of the ValueRef. Note that calling get methods on the ValueRef may cause a conversion to a different data type, but this is not guaranteed.

Interpret this value as i32.

Interpret this value as i64.

Interpret this value as f64.

Get the bytes of this BLOB value.

Safety

If the type of this value is not BLOB, the behavior of this function is undefined.

Interpret this value as a BLOB.

Provided Methods§

Convenience method equivalent to self.value_type() == ValueType::Null.

Attempt to interpret this value as a BLOB, without converting. If the underlying data type is not a BLOB, this function will fail with Err(SQLITE_MISMATCH).

Get the underlying TEXT value.

This method will fail if the value has invalid UTF-8.

Safety

If the type of this value is not TEXT, the behavior of this function is undefined.

Interpret the value as TEXT.

This method will fail if SQLite runs out of memory while converting the value, or if the value has invalid UTF-8.

Attempt to interpret this value as TEXT, without converting. If the underlying data type is not TEXT, this function will fail with Err(SQLITE_MISMATCH). This function can also fail if the string has invalid UTF-8.

Clone the value, returning a Value.

Implementors§