Sample usage
To get a paste from pastemyst synchronously:
use paste;
use PasteObject;
To create paste synchronously:
use paste;
use PasteObject;
More from the examples and documentation.
Feature support
Feature | Support | Async |
---|---|---|
API v1 | No | N/A |
API v2 | Yes | N/A |
Get pastes | Yes | Yes |
Get private pastes | Yes | Yes |
Create pastes | Yes | Yes |
Create Private pastes* | No | No |
Edit pastes | No | No |
Delete pastes | No | No |
Get Users | No | No |
Check if a user exists | No | No |
Get a language by name | No | No |
Get a language by extension | No | No |
*This also includes a paste to be tied to your account, or create a private/public paste, or with tags.
Repository structure
This is the current structure of the code:
./
├───.github/
│ ├─.workflows/
│ │ └─ rust.yml
│ └─ISSUE_TEMPLATES/
│ ├─ bug_report.md
│ ├─ feature_request.md
│ ├─ documentation.md
│ └ question.md
├───examples/
│ ├─ get_paste_async.rs
│ ├─ get_paste.rs
│ ├─ get_private_paste_async.rs
│ └─ get_private_paste.rs
├───src/
│ └─ lib.rs
├─── .gitattributes
├─── .gitignore
├─── Cargo.toml
├─── LICENSE
└─── README.MD
Building and Running
Being a Rust library, pastemyst-rs requires the Rust compiler installed. To check if it's installed, run: rustc --version
and cargo --version
to verify it. If it's not installed, install it from their site. Once that's cleared out; run cargo install
to get the packages. To test it on-hand, either
- Create a main.rs with the main method and run those tests (
cargo run
). - Run from the examples using
cargo run --example example_name
, for examplecargo run --example get_paste
.
Installation
If you want to use it in your rust application, it is recommended to get the crate from https://crates.io/crates/pastemyst-rs.
In your Cargo.toml
file, under [dependencies]
paste this:
= "<Replace this text with the latest version>"
# OR
= { = "<Replace this text with the latest version>" }
Versioning
pastemyst-rs uses SemVer.
Given a version number MAJOR.MINOR.PATCH, increment the
MAJOR
version when you make incompatible API changes,
MINOR
version when you add functionality in a backwards compatible manner, and
PATCH
version when you make backwards compatible bug fixes.Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
Help/Assistance
You can create an issue or just join the support (discord) server.