Struct dazeus::DaZeus
[−]
[src]
pub struct DaZeus<'a, T> { // some fields omitted }
The base DaZeus struct.
See the crate documentation for a more detailed instruction on how to get started with these DaZeus bindings.
Methods
impl<'a, T> DaZeus<'a, T> where T: Read + Write
fn new(conn: T) -> DaZeus<'a, T>
Create a new instance of DaZeus from the given connection.
fn listen(&self) -> Result<(), Error>
Loop wait for messages to receive in a blocking way.
fn subscribe<F>(&mut self, event: EventType, callback: F) -> (ListenerHandle, Response) where F: FnMut(Event, &DaZeusClient) + 'a
Subscribe to an event type and call the callback function every time such an event occurs.
fn subscribe_command<F>(&mut self, command: &str, callback: F) -> (ListenerHandle, Response) where F: FnMut(Event, &DaZeusClient) + 'a
Subscribe to a command and call the callback function every time such a command occurs.