From 6c1ddbf184a508df7e4027845819c1814d7d1a64 Mon Sep 17 00:00:00 2001 From: Ivan Ukhov Date: Wed, 23 Aug 2017 10:13:59 +0200 Subject: [PATCH] Add as_raw to Connection and Statement --- src/connection.rs | 6 ++++++ src/statement.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/connection.rs b/src/connection.rs index 8c18e2c..a56e908 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -131,6 +131,12 @@ impl Connection { } Ok(()) } + + /// Return the raw pointer. + #[inline] + pub fn as_raw(&self) -> *mut ffi::sqlite3 { + self.raw + } } impl Drop for Connection { diff --git a/src/statement.rs b/src/statement.rs index 7fef4a6..4fed850 100644 --- a/src/statement.rs +++ b/src/statement.rs @@ -101,6 +101,12 @@ impl<'l> Statement<'l> { pub fn cursor(self) -> Cursor<'l> { ::cursor::new(self) } + + /// Return the raw pointer. + #[inline] + pub fn as_raw(&self) -> *mut ffi::sqlite3_stmt { + self.raw.0 + } } impl<'l> Drop for Statement<'l> {