Crates.io | rspaste |
lib.rs | rspaste |
version | 0.1.5 |
source | src |
created_at | 2022-05-17 15:31:24.887911 |
updated_at | 2024-01-09 15:24:11.094298 |
description | Minimal, blazing-fast JSPaste API library |
homepage | |
repository | https://github.com/aidakdev/rspaste |
max_upload_size | |
id | 588392 |
size | 22,655 |
A minimal, blazing-fast and fully-typed JSPaste API library for Rust
Put the desired version of the crate into the dependencies section of your Cargo.toml:
[dependencies]
rspaste = { version = "0.1.5" }
First of all, the JSPaste API may return errors if something goes wrong, so using pattern matching is a good idea:
match some_doc {
Ok(d) => todo!(), // ...
Err(e) => todo!() // ...
}
We recommend doing this with every request to ensure that all cases are covered.
use rspaste;
fn main() {
let doc = rspaste::api::get("key"); // get document
let created_doc = rspaste::api::post("content"); // post document
let deleted_doc = rspaste::api::delete("key", "secret"); // delete document
}