mattermost-client 0.2.0

A sane Rust interface to the Mattermost API
Documentation

mattermost-client

This crate is a sane Rust interface to the Mattermost API.

Example

use mattermost_client::Client;

let client = Client::new("https://<YOUR MATTERMOST INSTANCE URL>")
    .with_user_agent("MyLittleSoftware/1.0")
    .with_access_token("<YOUR MATTERMOST ACCESS TOKEN>");

client
    .posts()
    .create_post()
    .channel_id("#welcome")
    .props(serde_json::json!({
        "name": "Example",
    }))
    .message("Hello world!")
    .build()
    .send(&client)
    .await
    .into_diagnostic()?;

Installation

Add this in your Cargo.toml:

[dependencies]
mattermost-client = "0.2"