pub fn login(token: &str) -> Result<RtmClient, Error> {
        let client = reqwest::Client::new();
        let start_response = api::rtm::start(&client, token, &Default::default())?;

        // setup channels for passing messages
        let (tx, rx) = channel::<WsMessage>();
        let sender = Sender::new(TxType::Sync(tx));

        Ok(RtmClient {
               start_response: start_response,
               sender: sender,
               rx: rx,
           })
    }
/// Logs in to slack. Call this before calling `run`.
/// Alternatively use `login_and_run`.
Logs in to slack. Call this before calling `run`.
Logs in to slack . Call this before calling ` run ` .
pub fn login(token: &str) -> Result<RtmClient, Error> {
        let client = reqwest::Client::new();
        let start_response = api::rtm::start(&client, token, &Default::default())?;
        // setup channels for passing messages
        let (tx, rx) = channel::<WsMessage>();
        let sender = Sender::new(TxType::Sync(tx));
        Ok(RtmClient {
               start_response: start_response,
               sender: sender,
               rx: rx,
           })
    }
pub fn login ( token : & str ) -> Result < RtmClient , Error > { let client = reqwest :: Client :: new ( ) ; let start_response = api :: rtm :: start ( & client , token , & Default :: default ( ) ) ? ; // setup channels for passing messages let ( tx , rx ) = channel :: < WsMessage > ( ) ; let sender = Sender :: new ( TxType :: Sync ( tx ) ) ; Ok ( RtmClient { start_response : start_response , sender : sender , rx : rx , } ) }
Logs in to slack.
Logs in to slack .
token
&str
token
&str