pushover

Crates.iopushover
lib.rspushover
version0.4.0
sourcesrc
created_at2017-08-27 15:25:29.95481
updated_at2022-04-30 15:34:55.993961
descriptionA wrapper for the Pushover API.
homepagehttps://github.com/sb89/pushover
repositoryhttps://github.com/sb89/pushover.git
max_upload_size
id29465
size70,046
Steven Blake (sb89)

documentation

https://docs.rs/pushover

README

Pushover

Build Status License Crates.io Docs.rs

A Rust wrapper for the Pushover API (https://pushover.net/api).

Installation

Usage

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"));
}
Commit count: 17

cargo fmt