Crate tebex_headless_rust
source ·Expand description
A wrapper library for Tebex’s Headless API, aka creating the serverside for your headless Tebex webstore.
Installation
tebex_headless_rust = "*"
Example Usage
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);
}
}
}
Modules
- This handlers directory contains all different functions, grouped into different modules/categories