Pastebin Rust Api
A Rust wrapper for the Pastebin Api
Installation
Add this to your Cargo.toml pastebin_rust_api = "0.2.11"
under [dependencies]
Getting started
Simple usage of Paster
:
extern crate pastebin_rust_api;
use pastebin_rust_api::{Paster, Access, Format, Expiration};
fn main() {
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() {
println!("{}", paste.content);
}
}
}
If you want to see examples for all methods,
check the test folder.