Crates.io | dbox |
lib.rs | dbox |
version | 0.1.3 |
source | src |
created_at | 2016-02-10 21:58:41.763613 |
updated_at | 2016-02-11 16:55:02.55167 |
description | An unofficial Dropbox SDK |
homepage | |
repository | https://github.com/pwoolcoc/dbox |
max_upload_size | |
id | 4145 |
size | 72,632 |
= Unofficial Dropbox SDK for Rust
image:https://travis-ci.org/pwoolcoc/dropbox-rs.svg?branch=master["Build Status", link="https://travis-ci.org/pwoolcoc/dropbox-rs"]
This is an (unofficial, as in not endorsed by) Dropbox SDK for https://rust-lang.org[Rust]. At present it is not complete, though the API is mostly fleshed out.
Currently it uses https://hyperium.github.io[Hyper] to communicate with the Dropbox API, but this is swappable, to allow a user to use their preferred HTTP library, or use more advanced features.
It is also very much lacking in tests and documentation.
== What's working
Right now the following API calls are available:
/files/copy
/files/create_folder
/files/delete
/files/download
/files/list_folder
/files/upload
== Examples
extern crate dbox;
use dbox::client::Client; use dbox::files;
const ACCESS_TOKEN: &'static str = "MY_ACCESS_TOKEN";
// compile with cargo build --no-default-features
extern crate dbox;
extern crate rustc_serialize;
use dbox::{DropboxClient, Result, Response}; use dbox::files;
struct MyClient;
impl DropboxClient for MyClient { fn access_token() -> &str { // return access token }
fn request<T>(&self, url: &str, headers: &mut BTreeMap<String, String>, body: &T) -> Result<Response>
where T: rustc_serialize::Encodable + Clone
{
// implement http request here
}
}