Crate pastebin_rust_api [] [src]

Pastebin Rust Api

Wrapper for the Pastebin Api

Getting started

Simple usage of Paster:

extern crate pastebin_rust_api;
use pastebin_rust_api::{Paster, Access, Format, Expiration};

fn main() {
    // I recommend to put your dev key into an environment variable called
    // `PASTEBIN_DEVELOPER_TOKEN`.
    let parser = Paster::new(Some("<YOUR DEV KEY>".to_owned()));
    let response = parser.paste("<html></html>",
                                Some(&Access::Private),
                                Some("TestHtml"),
                                Some(&Expiration::TenMinutes),
                                Some(&Format::HTML5),
                                None);
    if response.is_ok() {
        if let Some(paste) = response.ok() {
            // If everything is OK, you can get the url to your code here.
            println!("{}", paste);
        }
    }
}

Modules

objects

Structs

Paster

Represents an Paster object for executing pastes.

Enums

Access

Represents an Enum of possible access types for pastebin.

Expiration

Represents an enum of all possible expiration times.

Format

Represents an format enum for all compatible formats pastebin has.