| Crates.io | pushover |
| lib.rs | pushover |
| version | 0.4.0 |
| created_at | 2017-08-27 15:25:29.95481+00 |
| updated_at | 2022-04-30 15:34:55.993961+00 |
| description | A wrapper for the Pushover API. |
| homepage | https://github.com/sb89/pushover |
| repository | https://github.com/sb89/pushover.git |
| max_upload_size | |
| id | 29465 |
| size | 70,046 |
A Rust wrapper for the Pushover API (https://pushover.net/api).
Add the following to Cargo.toml:
[dependencies]
pushover = "0.4.0"
Synchronous example:
use pushover::API;
use pushover::requests::message::SendMessage;
fn send_message() {
let api = API::new();
let msg = SendMessage::new("token", "user_key", "hello");
let response = api.send(&msg);
println!("{:?}", response.expect("Error sending message"));
}
Asynchronous example:
use pushover::API;
use pushover::requests::message::SendMessage;
async fn send_message() {
let api = API::new();
let msg = SendMessage::new("token", "user_key", "hello");
let response = api.send_async(&msg).await;
println!("{:?}", response.expect("Error sending message"));
}