Add result_descriptions to Rows and Row
This can be useful for functions that are just passed a `Rows` or `Row` and want to introspect a bit into the columns.
This commit is contained in:
parent
e8f12a4a1e
commit
4d3e102f7e
10
src/lib.rs
10
src/lib.rs
@ -1364,6 +1364,11 @@ impl<'stmt> Rows<'stmt> {
|
||||
self.read_rows()
|
||||
}
|
||||
|
||||
/// Returns a slice describing the columns of the `Rows`.
|
||||
pub fn result_descriptions(&self) -> &'stmt [ResultDescription] {
|
||||
self.stmt.result_descriptions()
|
||||
}
|
||||
|
||||
/// Consumes the `Rows`, cleaning up associated state.
|
||||
///
|
||||
/// Functionally identical to the `Drop` implementation on `Rows`
|
||||
@ -1416,6 +1421,11 @@ impl<'stmt> Row<'stmt> {
|
||||
self.data.len()
|
||||
}
|
||||
|
||||
/// Returns a slice describing the columns of the `Row`.
|
||||
pub fn result_descriptions(&self) -> &'stmt [ResultDescription] {
|
||||
self.stmt.result_descriptions()
|
||||
}
|
||||
|
||||
/// Retrieves the contents of a field of the row.
|
||||
///
|
||||
/// A field can be accessed by the name or index of its column, though
|
||||
|
Loading…
Reference in New Issue
Block a user