rust-dropbox

crate.io

A convenient tool binding to the Dropbox APIv2, Now it can operate user_check,upload(file size below 150 MB), move and download. It will handle error messages from Dropbox api. And there is a async api can be activate by feature non-blocking.

For use, you need a Dropbox access token

Installation

Usage

blocking api

let token = env::var("DROPBOXTOKEN").unwrap(); let client = client::DBXClient::new(&token); let moveoption = MoveOption::new() .allowownershiptransfer() .allowsharedfolder() .allowautorename(); let res = client.movefile("/test/profile.jpg", "/profile.jpg", moveoption); assert!(res.is_ok()) ```

let token = env::var("DROPBOXTOKEN").unwrap(); let client = client::DBXClient::new(&token); let res = client.download("/profile.jpg"); let bytes = res.unwrap(); let mut file = File::create("newprofile.jpg").unwrap(); file.write_all(&bytes).unwrap(); ```

To use non-blocking api

toml rust-dropbox={version=*,default-features=false,features=["non-blocking"]}