myust: 📋=>🌐=>🦀
Introduction
myust is a rich and hybrid Rust wrapper for the mystb.in API that aims for user-flexibility.
myust supports hybrid clients:
- Client for asynchronous, and SyncClient for synchronous.
⚠️ Synchronous clients are only available on the sync feature.
Authentication
You can authenticate with the API using the auth
method with your
mystb.in, example:
use ;
let client = new.auth.await;
// or using synchronous client,
let client = new.auth;
It will panic if the provided token is invalid.
Installation
Add myust = "1.0"
to your Cargo.toml
file.
[]
= "1.0"
= "1.0"
If you want to use synchronous clients, add the sync
feature.
[]
= { = "1.0", = ["sync"] }
Usage Examples
Asynchronously creating a paste with tomorrow expiration date, with error handling:
use ;
async
Asynchronously deleting a paste (you must own the paste):
use AuthClient;
async
Synchronously creating a multifile paste with a password (you must have the sync
feature enabled):
use SyncClient;
You can check for another example snippets in the test folder.
Help & Contributing
If you need any help regarding myust, feel free to open an issue about your problem, and feel free to make a pull request for code improvements, bugfixing, etc.