Crates.io | rusty-box |
lib.rs | rusty-box |
version | 0.4.1-alpha |
source | src |
created_at | 2023-06-24 02:59:17.74478 |
updated_at | 2023-09-04 22:28:01.439861 |
description | Box.com API wrapper |
homepage | https://github.com/barduinor/rusty-box |
repository | https://github.com/barduinor/rusty-box |
max_upload_size | |
id | 898747 |
size | 231,317 |
Rusty Box is a Rust client for the Box API.
It is a work in progress and is not yet ready for production use.
To learn how to use Rusty Box, please refer to the documentation. There are some examples that may be useful as well.
cargo new my-box-project
cd my-box-project
cargo add dotenv
cargo add rusty-box
DEVELOPER_TOKEN=YOUR_DEVELOPER_TOKEN
use rusty_box::{
auth::{auth_developer::DeveloperToken, AuthError},
box_client::BoxClient,
config::Config,
rest_api::users::users_api,
};
use std::env;
#[tokio::main]
async fn main() -> Result<(), AuthError> {
dotenv::from_filename(".dev.env").ok();
let config = Config::new();
let auth = DeveloperToken::new(
config,
env::var("DEVELOPER_TOKEN").expect("DEVELOPER_TOKEN must be set"),
);
let mut client = BoxClient::new(Box::new(auth.clone()));
let fields = vec![];
let me = users_api::me(&mut client, Some(fields)).await?;
println!("Me:\n{me:#?}\n");
Ok(())
}
cargo run
Questions about Rusty Box usage and development can be asked on the Box community forum.
Please see the changelog for a release history and indications on how to upgrade from one version to another.
If you find any problems or have suggestions about this crate, please submit an issue. Moreover, any pull request, code review and feedback are welcome.