Database Status
Retrieve the current status of the database using the status method.
let status = db.status();Status Structure
The status variable will be of type Status, providing details about the database. The Status struct is defined as:
struct Status {
pub init: bool,
pub version: Option<String>,
pub name: String,
pub template: Option<String>,
}The Status struct always returns the same structure, containing the following fields:
- init: A boolean indicating whether the database is initialized (true) or not (false).
- version: An optional String representing the database version, if available.
- name: A String containing the name of the database.
- template: An optional String describing the database template, if available.
Example Outputs
When the database is initialized, the status might look like this:
Status {
init: true,
version: Some("1.0.0"),
name: "example-db",
template: Some("example-db"),
}If the database is uninitialized, the status will look like this:
Status {
init: false,
version: None,
name: "example-db",
template: None,
}