Struct exar::Collection [] [src]

pub struct Collection { /* fields omitted */ }

Exar DB's collection of events, containing the reference to the log and index files.

It is responsible of creating and managing the log scanner threads and the single-threaded logger. It allows publishing and subscribing to the underling events log.

Examples

extern crate exar;

use exar::*;

let collection_name = "test";
let collection_config = CollectionConfig::default();
let collection = Collection::new(collection_name, &collection_config).unwrap();

Methods

impl Collection
[src]

Creates a new instance of a collection with the given name and configuration or a DatabaseError if a failure occurs.

Publishes an event into the collection and returns the id for the event created or a DatabaseError if a failure occurs.

Subscribes to the collection of events using the given query and returns an event stream or a DatabaseError if a failure occurs.

Drops the collection, kills the scanner threads and remove the log and index files.

Trait Implementations

impl Debug for Collection
[src]

Formats the value using the given formatter.