rupushdeer

Crates.iorupushdeer
lib.rsrupushdeer
version0.1.0
sourcesrc
created_at2022-11-23 10:39:29.583333
updated_at2022-11-23 10:39:29.583333
descriptionPushDeer SDK for Rust.
homepage
repositoryhttps://github.com/abgelehnt/rupushdeer
max_upload_size
id721510
size35,593
Chi (abgelehnt)

documentation

https://docs.rs/rupushdeer

README

rupushdeer

PushDeer SDK for Rust.

install

[dependencies]
rupushdeer = "0.1.0"

Usage:

1. Use pushdeer default server

use rupushdeer::PushDeer;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let deer = PushDeer::new("PDU5315TCkMN0KiBRqbceaXxpYx3DvdbiZ3JpAIE");
    deer.send_text("title")?;
    deer.send_text_with_desp("Hello", "send_text_with_desp")?;
    deer.send_markdown("# markdown\npushdeer")?;
    deer.send_markdown_with_desp("# markdown\npushdeer", "send_markdown_with_desp")?;
    deer.send_image("https://gitee.com/easychen/pushdeer/raw/main/doc/image/clipcode.png")?;
    Ok(())
}

2. Use self-hosted server

use rupushdeer::PushDeer;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let deer = PushDeer::new("PDU5315TCkMN0KiBRqbceaXxpYx3DvdbiZ3JpAIE").set_server("http://127.0.0.1:12345");
    deer.send_text("title")?;
    Ok(())
}
Commit count: 3

cargo fmt