Struct exar_client::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
Methods
impl Client
[src]
fn connect<A: ToSocketAddrs>(
address: A,
collection_name: &str,
username: Option<&str>,
password: Option<&str>
) -> Result<Client, DatabaseError>
address: A,
collection_name: &str,
username: Option<&str>,
password: Option<&str>
) -> Result<Client, DatabaseError>
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<u64, DatabaseError>
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<EventStream, DatabaseError>
Subscribes using the given query and returns an event stream
or a DatabaseError
if a failure occurs.
fn close(self)
Closes the connection.