Struct exar::Database [] [src]

pub struct Database { /* fields omitted */ }

Exar DB's main component, containing the database configuration and the references to the collections of events created. It is used to create new connections.

Examples

extern crate exar;

use exar::*;

let config = DatabaseConfig::default();
let mut db = Database::new(config);

let collection_name = "test";
let connection = db.connect(collection_name).unwrap();

Methods

impl Database
[src]

Creates a new instance of the database with the given configuration.

Returns a connection instance with the given name or a DatabaseError if a failure occurs.

Returns an existing collection instance with the given name wrapped into an Arc/Mutex or a DatabaseError if a failure occurs, it creates a new collection if it does not exist.

Creates and returns a new collection instance with the given name wrapped into an Arc/Mutex or a DatabaseError if a failure occurs.

Drops the collection with the given name or returns an error if a failure occurs.

Returns wether a collection with the given name exists.

Trait Implementations

impl Clone for Database
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Database
[src]

Formats the value using the given formatter.