Crate pb_async[][src]

Asynchronous PushBullet client for Rust.

Usage

To use pb_async, first create a Client with an access token from the PushBullet account settings.

Then you can use any of the request methods on Client to perform API requests.

All requests are futures, so you'll need to run them in some kind of futures execution context. I recommend using the tokio crate.

Example

extern crate futures;
extern crate pb_async;
extern crate tokio;

use futures::Future;

let client = pb_async::Client::new("...").unwrap();

tokio::run(
    client.push(
        pb_async::PushTarget::SelfUser {},
        pb_async::PushData::Note {
            title: "",
            body: "Hello, user!",
        },
    ).or_else(|error| {
        eprintln!("error: {}", error);
        Ok(())
    })
);

See Client for more snippets.

Or find full example programs in the GitHub repository.

Structs

Client

PushBullet client

Device

PushBullet device

UploadRequestResponse

Response to Client::upload_request.

User

Information about logged in user.

Enums

PushData

Data which can be pushed.

PushTarget

Target which data can be pushed to.

RequestError

Error that can occur when running a request.

StartupError

Error that can occur when creating a client.