Struct slack::RtmClient [−][src]
pub struct RtmClient { /* fields omitted */ }
The actual messaging client.
Methods
impl RtmClient
[src]
impl RtmClient
pub fn login(token: &str) -> Result<RtmClient, Error>
[src]
pub fn login(token: &str) -> Result<RtmClient, Error>
Logs in to slack. Call this before calling run
.
Alternatively use login_and_run
.
pub fn run<T: EventHandler>(&self, handler: &mut T) -> Result<(), Error>
[src]
pub fn run<T: EventHandler>(&self, handler: &mut T) -> Result<(), Error>
Runs the message receive loop
pub fn login_and_run<T: EventHandler>(
token: &str,
handler: &mut T
) -> Result<(), Error>
[src]
pub fn login_and_run<T: EventHandler>(
token: &str,
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.
pub fn sender(&self) -> &Sender
[src]
pub fn sender(&self) -> &Sender
Get a reference thread-safe cloneable message Sender
pub fn start_response(&self) -> &StartResponse
[src]
pub fn start_response(&self) -> &StartResponse
Returns a reference to the StartResponse
.