slack-bk 0.1.1

Slack BlockKit API abstraction for Rust
Documentation
  • Coverage
  • 0%
    0 out of 221 items documented0 out of 43 items with examples
  • Size
  • Source code size: 107.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 12.11 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 28s Average build duration of successful builds.
  • all releases: 28s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • nsat/slack-bk
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nickpascucci spire-ffoston spire-josh-singer

slack-bk Build Status Docs Latest Version

Rust crate for Slack's BlockKit API

You'll probably want to reference Slack's documentation while using this crate.

Using slack-bk with an HTTP client

slack-bk does not come with a built in mechanism to talk to slack's API. There are many popular HTTP libraries in the rust ecosystem and the user is free to choose their own.

use reqwest::{Client, Error};
use slack_bk::surfaces::Message;

async fn send_to_webhook(webhook: &str, client: &Client, msg: Message) -> Result<(), Error> {
    client
        .post(webhook)
        .json(&msg)
        .send()
        .await?
        .error_for_status()?
        .map(|_| ())

}