pub struct DBEnv {
pub historian: Historian,
/* private fields */
}
336
337
338
pub async fn close(self) {
self.db_env.close().await;
}
More examples
Hide additional examples
14
15
16
17
18
19
20
21
pub async fn close(self) {
match self {
Self::None => (),
Self::Repo(repo) => repo.close().await,
Self::Historian(historian) => historian.close().await,
Self::Env(env) => env.close().await,
}
}
12
13
14
15
16
17
18
19
20
pub async fn init_env(mut need_journal: bool) -> Result<(DBEnv, bool)> {
async fn init_historian() -> Result<Historian> {
let h = Historian::new(path::get_home().to_owned()).await?;
Ok(h)
}
let ((pool, init), historian) =
try_join!(crate::db::get_pool(&mut need_journal), init_historian())?;
Ok((DBEnv::new(pool, historian, need_journal), init))
}
Formats the value using the given formatter.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.