mattermost-client

Crates.iomattermost-client
lib.rsmattermost-client
version0.1.2
sourcesrc
created_at2023-05-12 09:06:01.927751
updated_at2023-05-13 21:00:26.290122
descriptionAn attempt to provde a sane Rust interface to the Mattermost API
homepage
repositoryhttps://gitlab.com/vigigloo/libs/mattermost-client
max_upload_size
id862816
size2,627,218
Rust (github:fractalglobal:rust)

documentation

README

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"
Commit count: 5

cargo fmt