yunpian-sdk

Crates.ioyunpian-sdk
lib.rsyunpian-sdk
version0.1.1
sourcesrc
created_at2022-11-03 08:28:14.544853
updated_at2022-11-03 08:33:44.059719
description云片短信sdk
homepage
repositoryhttps://github.com/annidiea/yunpian-rust-sdk
max_upload_size
id704140
size34,609
安妮碟阿 (annidiea)

documentation

https://docs.rs/yunpian-sdk

README

#云片短信SDK

官网5年前提交的sdk先已不能使用,特更新了一个

This crate offers:

  • 官网5年前提交的sdk已不能使用,特更新了一个

Features:

  • macOS, Windows and Linux support;

Installation

将所需版本的crate放入dependencies的部分 Cargo.toml:

[dependencies]
yunpian-sdk = "*"

Example


#[tokio::main]
async fn main() {
    let api_key = "云片api_key";
    let sms = yunpian_sdk::Yunpian::new(api_key);
    let text = "【安妮蝶网络】您的验证码为1024,10分钟内有效,请勿泄露。如非本人操作,请忽略本短信。";
    let phone = "18610996705";
    match sms.single_send(text, phone).await{
        Ok(b) => {
            if b == true {
                println!("发送成功")
            }else{
                print!("发送失败")
            }
        },
        Err(e) => {
            println!("err: {}", e)
        }
    };
}


Crate Features

  • crate's features:

API Documentation

Please refer to the crate docs

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 4

cargo fmt