The library uses asynchronous HTTP client reqwest, so your Cargo.toml could look like this:
toml
rocketchat = "0.4.0"
tokio = { version = "1", features = ["full"] }
```rust,no_run use rocketchat::{LoginSettings, Settings};
let settings = Settings::Login(LoginSettings { username: "chucknorris".tostring(), password: "supersecret".tostring(), domain: "https://mydomain.com".tostring(), }); ```
```rust,no_run use rocketchat::{AuthSettings, Settings};
let settings = Settings::Auth(AuthSettings { authtoken: "someauthtoken".tostring(), userid: "someuserid".tostring(), domain: "https://mydomain.com".to_string(), }); ```
```rust,no_run use rocketchat::methods::PostMessageMethod;
let result = PostMessageMethod { settings: &settings, roomid: "#channel".tostring(), text: Some("Some message with star emoji :star:".to_string()), ..Default::default() }.call().await; ```
```rust,no_run use rocketchat::methods::ChannelCreateMethod;
let result = ChannelCreateMethod { settings: &settings, name: "some-channel".tostring(), members: Some(vec!["rocket.cat".tostring()]), ..Default::default() }.call().await; ```
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)