Function notmuch_sys::notmuch_database_close
[−]
[src]
pub unsafe extern "C" fn notmuch_database_close(
database: *mut notmuch_database_t
) -> notmuch_status_t
Commit changes and close the given notmuch database.
After notmuch_database_close
has been called, calls to other
functions on objects derived from this database may either behave
as if the database had not been closed (e.g., if the required data
has been cached) or may fail with a
notmuch_status_t::XAPIAN_EXCEPTION
. The only further operation
permitted on the database itself is to call notmuch_database_destroy
.
notmuch_database_close
can be called multiple times. Later calls have
no effect.
For writable databases, notmuch_database_close
commits all changes
to disk before closing the database. If the caller is currently in
an atomic section (there was a notmuch_database_begin_atomic
without a matching notmuch_database_end_atomic
), this will discard
changes made in that atomic section (but still commit changes made
prior to entering the atomic section).
Return value:
notmuch_status_t::SUCCESS
: Successfully closed the database.notmuch_status_t::XAPIAN_EXCEPTION
: A Xapian exception occurred; the database has been closed but there are no guarantees the changes to the database, if any, have been flushed to disk.