#access-token #mattermost #attempt

mattermost-client

An attempt to provde a sane Rust interface to the Mattermost API

3 releases

0.1.2 May 13, 2023
0.1.1 May 12, 2023
0.1.0 May 12, 2023

#426 in Authentication

47 downloads per month

MIT license

2MB
32K SLoC

mattermost-client

This crate is an attempt to provde 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.1"

Dependencies

~5–19MB
~281K SLoC