mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 12:42:18 +08:00
Implement AsRef<Statement> for Row(s) (#887)
This commit is contained in:
11
src/row.rs
11
src/row.rs
@@ -78,6 +78,11 @@ impl<'stmt> Rows<'stmt> {
|
||||
{
|
||||
AndThenRows { rows: self, map: f }
|
||||
}
|
||||
|
||||
/// Give access to the underlying statement
|
||||
pub fn as_ref(&self) -> Option<&Statement<'stmt>> {
|
||||
self.stmt
|
||||
}
|
||||
}
|
||||
|
||||
impl<'stmt> Rows<'stmt> {
|
||||
@@ -358,6 +363,12 @@ impl<'stmt> Row<'stmt> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'stmt> AsRef<Statement<'stmt>> for Row<'stmt> {
|
||||
fn as_ref(&self) -> &Statement<'stmt> {
|
||||
self.stmt
|
||||
}
|
||||
}
|
||||
|
||||
mod sealed {
|
||||
/// This trait exists just to ensure that the only impls of `trait Params`
|
||||
/// that are allowed are ones in this crate.
|
||||
|
Reference in New Issue
Block a user