Crates.io | mta-sdk |
lib.rs | mta-sdk |
version | 0.1.2 |
source | src |
created_at | 2023-08-19 03:40:09.954714 |
updated_at | 2023-08-19 14:46:04.329399 |
description | A Rust SDK for the MTA API |
homepage | |
repository | https://github.com/Z4Dev/mta-sdk |
max_upload_size | |
id | 948476 |
size | 38,157 |
The mta-sdk is a Rust library designed to provide ease of calling functions in the MTA
[dependencies]
mta-sdk = "0.1.2"
or
cargo add mta-sdk
#[tokio::main]
async fn main() {
let auth: client::Auth = client::Auth {
username: "User".to_string(),
password: "Password".to_string(),
};
let mta = client::Mta::new(String::from("127.0.0.1"), 22005, auth, true);
let res = mta
.call("resource_name", "function_name", vec!["arg1".to_string(), "arg2".to_string()])
.await;
match res {
Ok(res) => println!("{}", res),
Err(err) => println!("{}", err)
}
}