mattermost_api/lib.rs
1//! Mattermost API wrapper.
2//!
3//! For the full Mattermost API information, see [their docs].
4//!
5//! To start, create an instance of the [`AuthenticationData`]
6//! struct, passing in either a login_id and password (likely
7//! email and password), or a personal access token. Pass this
8//! struct instance along with the URL of the target Mattermost
9//! instance to [`Mattermost::new`].
10//!
11//! # Example
12//!
13//! ```rust,no_run
14//! use mattermost_api::prelude::*;
15//! # async fn run() {
16//! let auth = AuthenticationData::from_password("you@example.com", "password");
17//! let mut api = Mattermost::new("https://your-mattermost-instance.com", auth).unwrap();
18//! api.store_session_token().await.unwrap();
19//! let team_info = api.get_team("Best-Team-Ever").await.unwrap();
20//! # }
21//! ```
22//!
23//! [their docs]: https://api.mattermost.com
24//! [`AuthenticationData`]: struct.AuthenticationData.html
25//! [`Mattermost::new`]: struct.Mattermost.html
26
27#![deny(clippy::all)]
28#![deny(unsafe_code)]
29#![warn(missing_docs)]
30
31pub mod client;
32pub mod errors;
33pub mod models;
34pub mod prelude;
35pub mod socket;
36/// Re-exported since websocket events have untyped data for now
37pub use serde_json::Value;