Skip to main content

DbRow

Struct DbRow 

Source
pub struct DbRow {
    pub values: Vec<DbValue>,
}
Expand description

One result row: a positional list of column values.

Fields§

§values: Vec<DbValue>

The row’s column values, in SELECT/column order.

Implementations§

Source§

impl DbRow

Source

pub fn get_i64(&self, idx: usize) -> Result<i64, DbError>

Read column idx as an i64. Errors if it is NULL, not an integer, or out of bounds.

Source

pub fn get_text(&self, idx: usize) -> Result<&str, DbError>

Read column idx as text. Errors if it is NULL, not text, or out of bounds.

Source

pub fn get_blob(&self, idx: usize) -> Result<&[u8], DbError>

Read column idx as a byte blob. Errors if it is NULL, not a blob, or out of bounds.

Source

pub fn get_u64(&self, idx: usize) -> Result<u64, DbError>

Read a column written via DbValue::from_u64: a stored integer that must be non-negative. Mirrors the checked write so a u64 round-trips through a signed column without a lossy as cast; a negative stored value (corruption or a hand-edit) is rejected rather than wrapped to a huge u64 that would jump the clock to the end of time.

Source

pub fn get_optional_u64(&self, idx: usize) -> Result<Option<u64>, DbError>

Read an optional column written via DbValue::from_u64: a stored integer that must be non-negative. Mirrors the checked write so a u64 round-trips through a signed column without a lossy as cast; a negative stored value (corruption or a hand-edit) is rejected rather than wrapped to a huge u64 that would jump the clock to the end of time.

Source

pub fn get_bool(&self, idx: usize) -> Result<bool, DbError>

Read column idx as a bool — a stored integer, true iff nonzero. Errors if it is NULL, not an integer, or out of bounds.

Source

pub fn get_optional_i64(&self, idx: usize) -> Result<Option<i64>, DbError>

Read column idx as an optional i64: None when NULL. Errors if it is not an integer or out of bounds.

Source

pub fn get_optional_text(&self, idx: usize) -> Result<Option<&str>, DbError>

Read column idx as optional text: None when NULL. Errors if it is not text or out of bounds.

Source

pub fn get_uuid(&self, idx: usize) -> Result<[u8; 16], DbError>

Read column idx as a 16-byte UUID, accepting either a native UUID value or a 16-byte blob. Errors if it is NULL, a wrong-length blob, another type, or out of bounds.

Source

pub fn get_optional_uuid(&self, idx: usize) -> Result<Option<[u8; 16]>, DbError>

Read column idx as an optional 16-byte UUID (native UUID or 16-byte blob): None when NULL. Errors on a wrong-length blob, another type, or out of bounds.

Source

pub fn get_optional_blob(&self, idx: usize) -> Result<Option<&[u8]>, DbError>

Read column idx as an optional byte blob: None when NULL. Errors if it is not a blob or out of bounds.

Trait Implementations§

Source§

impl Debug for DbRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for DbRow

§

impl RefUnwindSafe for DbRow

§

impl Send for DbRow

§

impl Sync for DbRow

§

impl Unpin for DbRow

§

impl UnsafeUnpin for DbRow

§

impl UnwindSafe for DbRow

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.