[−][src]Struct rusqlite::Row
A single result row of a query.
Methods
impl<'stmt> Row<'stmt>
[src][−]
pub fn column_names(&self) -> Vec<&str>
[src][−]
Get all the column names of the Row.
pub fn column_count(&self) -> usize
[src][−]
Return the number of columns in the current row.
pub fn column_name(&self, col: usize) -> Result<&str>
[src][−]
Return the name of the column.
pub fn column_index(&self, name: &str) -> Result<usize>
[src][−]
Return the index of the column.
pub fn columns(&self) -> Vec<Column>
[src][−]
Returns a slice describing the columns of the Row.
impl<'stmt> Row<'stmt>
[src][−]
pub fn get_unwrap<I: RowIndex, T: FromSql>(&self, idx: I) -> T
[src][−]
Get the value of a particular column of the result row.
Failure
Panics if calling row.get(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
pub fn get<I: RowIndex, T: FromSql>(&self, idx: I) -> Result<T>
[src][−]
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.
pub fn get_raw_checked<I: RowIndex>(&self, idx: I) -> Result<ValueRef>
[src][−]
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
.
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.
pub fn get_raw<I: RowIndex>(&self, idx: I) -> ValueRef
[src][−]
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
.
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.
Auto Trait Implementations
impl<'stmt> !RefUnwindSafe for Row<'stmt>
impl<'stmt> !Send for Row<'stmt>
impl<'stmt> !Sync for Row<'stmt>
impl<'stmt> Unpin for Row<'stmt>
impl<'stmt> !UnwindSafe for Row<'stmt>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,