Crates.io | tebex_headless_rust |
lib.rs | tebex_headless_rust |
version | 0.1.3 |
source | src |
created_at | 2023-12-05 19:01:40.168731 |
updated_at | 2023-12-15 19:52:57.49043 |
description | Wrapper library for Tebex's Headless API |
homepage | |
repository | https://github.com/Z3rio/tebex_headless_rust |
max_upload_size | |
id | 1058945 |
size | 94,058 |
A wrapper library for Tebex's Headless API, aka creating the serverside for your headless Tebex webstore.
This is a simple but straight forward to use wrapper library for Tebex's Headless API. If you do not know what that is already, then please read this first.
use tebex_headless_rust::handlers::{misc::set_public_api_key, package::get_all_packages};
// tokio is used to allow an async main function
#[tokio::main]
async fn main() {
// set public api key
set_public_api_key(String::from("public_api_key_tebex"));
// fetch packages
let packages = get_all_packages(None, None).await;
match packages {
// if packages successfully fetched
Ok (packages) => {
println!("Package amount: {}", packages.len());
}
// handle issue with fetching of packages
Err (err) => {
println!("Could not fetch pacakges: {}", err);
}
}
}
If you encounter an issue with our template, simply open an issue here
We gladly accept all contributions, contributing can be done via forking this repo and then creating a PR.