#sdk #mta #api #tokio #function

bin+lib mta-sdk

A Rust SDK for the MTA API

3 releases

0.1.2 Aug 19, 2023
0.1.1 Aug 19, 2023
0.1.0 Aug 19, 2023

#4 in #mta

Download history 3/week @ 2024-02-20 18/week @ 2024-02-27 10/week @ 2024-03-26 42/week @ 2024-04-02

52 downloads per month

MIT license

12KB
92 lines

MTA-SDK

The mta-sdk is a Rust library designed to provide ease of calling functions in the MTA

Installation

[dependencies]
mta-sdk = "0.1.2"

or

cargo add mta-sdk

Usage

#[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)
    }
}

Documentation

Documentation

Dependencies

~6–21MB
~279K SLoC