pub enum ValueRef<'a> {
Null,
Integer(i64),
Float(f64),
Text(&'a str),
Blob(&'a [u8]),
}Expand description
Borrowed SQLite value view.
Variants§
Null
SQL NULL.
Integer(i64)
Borrowed 64-bit integer.
Float(f64)
Borrowed 64-bit floating point.
Text(&'a str)
Borrowed UTF-8 text.
Blob(&'a [u8])
Borrowed bytes.
Implementations§
Source§impl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
Sourcepub fn value_type(&self) -> ValueType
pub fn value_type(&self) -> ValueType
Return the SQLite value type tag for this borrowed value.
Sourcepub unsafe fn from_raw_text(raw: RawBytes) -> ValueRef<'a>
pub unsafe fn from_raw_text(raw: RawBytes) -> ValueRef<'a>
§Safety
Caller must ensure raw points to valid bytes for the duration of 'a.
If raw is valid UTF-8 this returns ValueRef::Text; otherwise it
falls back to ValueRef::Blob to avoid unchecked UTF-8 assumptions.
Sourcepub unsafe fn from_raw_blob(raw: RawBytes) -> ValueRef<'a>
pub unsafe fn from_raw_blob(raw: RawBytes) -> ValueRef<'a>
§Safety
Caller must ensure raw points to valid bytes for the duration of 'a.
Trait Implementations§
impl<'a> Copy for ValueRef<'a>
impl<'a> StructuralPartialEq for ValueRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ValueRef<'a>
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> UnsafeUnpin for ValueRef<'a>
impl<'a> UnwindSafe for ValueRef<'a>
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