Struct rusqlite::Row

source ·
pub struct Row<'a, 'stmt: 'a> { /* private fields */ }
Expand description

A single result row of a query.

Implementations§

Get the value of a particular column of the result row.

Failure

Panics if calling row.get_checked(idx) would return an error, including:

  • If the underlying SQLite column type is not a valid type as a source for T
  • If the underlying SQLite integral value is outside the range representable by T
  • If idx is outside the range of columns in the returned query

Get the value of a particular column of the result row.

Failure

Returns an Error::InvalidColumnType if the underlying SQLite column type is not a valid type as a source for T.

Returns an Error::InvalidColumnIndex if idx is outside the valid column range for this row.

Returns an Error::InvalidColumnName if idx is not a valid column name for this row.

If the result type is i128 (which requires the i128_blob feature to be enabled), and the underlying SQLite column is a blob whose size is not 16 bytes, Error::InvalidColumnType will also be returned.

Get the value of a particular column of the result row as a ValueRef, allowing data to be read out of a row without copying.

This ValueRef is valid only as long as this Row, which is enforced by it’s lifetime. This means that while this method is completely safe, it can be somewhat difficult to use, and most callers will be better served by get or get_checked.

Failure

Returns an Error::InvalidColumnIndex if idx is outside the valid column range for this row.

Returns an Error::InvalidColumnName if idx is not a valid column name for this row.

Get the value of a particular column of the result row as a ValueRef, allowing data to be read out of a row without copying.

This ValueRef is valid only as long as this Row, which is enforced by it’s lifetime. This means that while this method is completely safe, it can be difficult to use, and most callers will be better served by get or get_checked.

Failure

Panics if calling row.get_raw_checked(idx) would return an error, including:

  • If idx is outside the range of columns in the returned query.
  • If idx is not a valid column name for this row.

Return the number of columns in the current row.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.