Crate pushover [] [src]

Pushover API Wrapper

https://pushover.net/api

Usage

Add the following to Cargo.toml:

Be careful when using this code, it's not being tested!
[dependencies]
pushover = "0.3.0"

Synchronous example:

extern crate pushover;

use pushover::SyncAPIBuilder;
use pushover::requests::message::SendMessage;

fn main() {
    let api = SyncAPIBuilder::new().build().expect("Error creating API");

    let msg = SendMessage::new("token", "user_key", "hello");

    let response = api.send(&msg);
    println!("{:?}", response);
}

Asynchronous example:

extern crate pushover;
extern crate tokio_core;

use pushover::AsyncAPIBuilder;
use pushover::requests::message::SendMessage;
use tokio_core::reactor::Core;

fn main() {
    let mut core = Core::new().expect("Error creating core");
    let handle = core.handle();

    let api = AsyncAPIBuilder::new().build(&handle).expect("Error creating API");

    let msg = SendMessage::new("token", "user_key", "hello");
    let work = api.send(&msg);

    println!("{:?}", core.run(work).expect("Error sending message"));
}

Modules

requests

Structs

AsyncAPI
AsyncAPIBuilder
Error

The Error type.

PushoverFuture

A future that resolves into a Pushover response.

SyncAPI
SyncAPIBuilder
User

Enums

ErrorKind

The kind of an error.

OperatingSystem
Priority
Sound
UserType