Skip to content

sb89/pushover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pushover

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"));
}

About

A Rust wrapper for the Pushover API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages