Struct slack::RtmClient
[−]
[src]
pub struct RtmClient { /* fields omitted */ }
The actual messaging client.
Methods
impl RtmClient
[src]
fn login(token: &str) -> Result<RtmClient, Error>
Logs in to slack. Call this before calling run
.
Alternatively use login_and_run
.
fn run<T: EventHandler>(&self, handler: &mut T) -> Result<(), Error>
Runs the message receive loop
fn login_and_run<T: EventHandler>(token: &str,
handler: &mut T)
-> Result<(), Error>
handler: &mut T)
-> Result<(), Error>
Runs the main loop for the client after logging in to slack.
Returns an error if the process fails at any point, or an Ok(()) on successful close.
Takes an EventHandler
implemented by the user which will be called when Event
s are
received.
fn sender(&self) -> &Sender
Get a reference thread-safe cloneable message Sender
fn start_response(&self) -> &StartResponse
Returns a reference to the StartResponse
.