Struct exar_client::Client [] [src]

pub struct Client {
    // some fields omitted
}

Exar DB's client

Methods

impl Client
[src]

fn connect<A: ToSocketAddrs>(address: A, collection_name: &str, username: Option<&str>, password: Option<&str>) -> Result<ClientDatabaseError>

Connects to the given address and collection, optionally using the credentials provided, it returns a Client or a DatabaseError if a failure occurs.

fn publish(&mut self, event: Event) -> Result<u64DatabaseError>

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

fn subscribe(&mut self, query: Query) -> Result<EventStreamDatabaseError>

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

fn close(self)

Closes the connection.