diff options
| author | C. Morgan Hamill <me@cmhamill.org> | 2015-03-20 16:38:32 +0100 |
|---|---|---|
| committer | C. Morgan Hamill <me@cmhamill.org> | 2015-03-20 16:38:32 +0100 |
| commit | 08a7366e0e561160a2b5a1dc01330f3f7f467469 (patch) | |
| tree | 3997b3a3d03c5dcc1ceea99780b00e0c8763abf4 | |
| parent | 98cba2aa2f2aea029ef498560658d862284db6ca (diff) | |
| download | mail-08a7366e0e561160a2b5a1dc01330f3f7f467469.tar.gz | |
Add `Database::close()` method.
Simple wrapper around notmuch API's `notmuch_database_close()` function.
| -rw-r--r-- | src/database.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/database.rs b/src/database.rs index 3955865..1915ffe 100644 --- a/src/database.rs +++ b/src/database.rs @@ -48,6 +48,14 @@ impl Database { Ok(Database(db)) } + pub fn close(self) -> Result<()> { + try!(unsafe { + ffi::notmuch_database_close(self.0) + }.as_result()); + + Ok(()) + } + pub fn compact<P: path::AsPath, F: FnMut(&str)>( path: &P, backup_path: Option<&P>, ) -> Result<()> { |
