pub struct Database { /* private fields */ }
Implementations
sourceimpl Database
impl Database
pub fn create<P>(path: P) -> Result<Self, Error> where
P: AsRef<Path>,
pub fn open<P>(path: P, mode: DatabaseMode) -> Result<Self, Error> where
P: AsRef<Path>,
👎 Deprecated:
Replaced with open_with_config
pub fn open_with_config<DP, CP>(
database_path: Option<DP>,
mode: DatabaseMode,
config_path: Option<CP>,
profile: Option<&str>
) -> Result<Self, Error> where
DP: AsRef<Path>,
CP: AsRef<Path>,
pub fn close(&self) -> Result<(), Error>
pub fn compact<P, F>(path: P, backup_path: Option<&P>) -> Result<(), Error> where
P: AsRef<Path>,
F: FnMut(&str),
pub fn compact_with_status<P, F>(
path: P,
backup_path: Option<&P>,
status: F
) -> Result<(), Error> where
P: AsRef<Path>,
F: FnMut(&str),
pub fn path(&self) -> &Path
pub fn version(&self) -> u32
pub fn revision(&self) -> Revision
pub fn needs_upgrade(&self) -> bool
pub fn upgrade<F>(&self) -> Result<(), Error> where
F: FnMut(f64),
pub fn upgrade_with_status<F>(&self, status: F) -> Result<(), Error> where
F: FnMut(f64),
pub fn directory<P>(&self, path: P) -> Result<Option<Directory>, Error> where
P: AsRef<Path>,
pub fn config_list(&self, prefix: &str) -> Result<ConfigList, Error>
pub fn config(&self, key: ConfigKey) -> Option<String>
pub fn config_set(&self, key: ConfigKey, val: &str) -> Result<(), Error>
pub fn config_values(&self, key: ConfigKey) -> Option<ConfigValues>
pub fn config_values_string(&self, key: &str) -> Option<ConfigValues>
pub fn config_pairs(&self, prefix: &str) -> Option<ConfigPairs>
pub fn config_bool(&self, key: ConfigKey) -> Result<bool, Error>
pub fn config_path(&self) -> Option<&Path>
pub fn create_query(&self, query_string: &str) -> Result<Query, Error>
pub fn find_message(&self, message_id: &str) -> Result<Option<Message>, Error>
pub fn find_message_by_filename<P>(
&self,
filename: &P
) -> Result<Option<Message>, Error> where
P: AsRef<Path>,
pub fn remove_message<P>(&self, path: P) -> Result<(), Error> where
P: AsRef<Path>,
pub fn default_indexopts(&self) -> Result<IndexOpts, Error>
pub fn index_file<P>(
&self,
path: P,
indexopts: Option<IndexOpts>
) -> Result<Message, Error> where
P: AsRef<Path>,
pub fn begin_atomic(&self) -> Result<(), Error>
pub fn end_atomic(&self) -> Result<(), Error>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Database
impl !Send for Database
impl !Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more