{"id":21659753,"url":"https://github.com/dropbox/dropbox-sdk-rust","last_synced_at":"2025-07-17T22:33:05.439Z","repository":{"id":35101380,"uuid":"206682290","full_name":"dropbox/dropbox-sdk-rust","owner":"dropbox","description":"Dropbox SDK for Rust","archived":false,"fork":false,"pushed_at":"2024-04-01T20:04:45.000Z","size":7005,"stargazers_count":74,"open_issues_count":4,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-17T02:07:42.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-06T00:46:45.000Z","updated_at":"2024-01-21T13:24:02.000Z","dependencies_parsed_at":"2024-01-17T08:46:04.101Z","dependency_job_id":"3bd9eee2-a0b9-4839-b355-7cc16c5bc354","html_url":"https://github.com/dropbox/dropbox-sdk-rust","commit_stats":{"total_commits":304,"total_committers":7,"mean_commits":43.42857142857143,"dds":"0.35526315789473684","last_synced_commit":"c8c6c9aaa354d6dabdbbe70116c0a6cbf9618060"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdropbox-sdk-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdropbox-sdk-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdropbox-sdk-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdropbox-sdk-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropbox","download_url":"https://codeload.github.com/dropbox/dropbox-sdk-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226305722,"owners_count":17603863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T09:31:29.463Z","updated_at":"2025-07-17T22:33:05.426Z","avatar_url":"https://github.com/dropbox.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Dropbox SDK for Rust\n\n[![Crates.io](https://img.shields.io/crates/v/dropbox-sdk)](https://crates.io/crates/dropbox-sdk)\n[![docs.rs](https://docs.rs/dropbox-sdk/badge.svg)](https://docs.rs/dropbox-sdk/)\n\nRust bindings to the Dropbox APIv2, generated by Stone from the official spec.\n\nThe Stone SDK and Dropbox API spec used to generate the code are in the `stone`\nand `dropbox-api-spec` submodules, respectively. Use `git submodule init` and\n`git submodule update` to fetch them.\n\nThe generated code is checked in under `src/generated` in order to simplify\nbuilding. To regenerate or update it, run `python generate.py`.  Doing so\nrequires a working Python environment and some dependencies. See the Stone\ndocumentation for details.\n\n## Status of this SDK\n\nThis SDK is not yet official. What does this mean?\n* There is no formal Dropbox support for the SDK at this point.\n* Bugs may or may not get fixed.\n* Not all SDK features may be implemented.\n\nHowever, that said,\n* The SDK is usable!\n* We are happy to get feedback and/or pull requests from the community! See\n[contributing](CONTRIBUTING.md) for more information.\n\n## Sync and Async\n\nThe routes (functions) come in two variants: sync, which do blocking network\nI/O and return their value directly; and async, which return futures.\n\nThe sync routes (in the `dropbox_sdk::sync_routes` module) are enabled by\ndefault or with the `sync_routes` feature, and likewise the async ones are\nin the `dropbox_sdk::async_routes` module and can be enabled with the\n`async_routes` feature.\n\nAdditionally, if the `sync_routes_default` feature is on (as it is by\ndefault), the sync routes are available directly as `dropbox_sdk::{namespace}`,\nwhich matches the original structure before the async routes were added.\n\n## HTTP Client\n\nTo actually use the API calls, you need a HTTP client -- all functions take a\ntype that implements `HttpClient` as their first argument.  This trait is\nlocated at `dropbox_sdk::client_trait::HttpClient`. Implement this trait and\npass it as the client argument.\n\nIf you don't want to implement your own, this SDK comes with an optional\ndefault client that uses `ureq` and `rustls`.  To use it, build with the\n`default_client` feature flag, and then there will be a set of clients in the\n`dropbox_sdk::default_client` module that you can use, corresponding to each of\nthe authentication types Dropbox uses (see below). The default client needs a\nDropbox API token; how you get one is up to you and your program. See the\nprograms under [examples/](examples/) for examples, and see the helper code in\nthe [oauth2](src/oauth2.rs) module.\n\nAsync clients can be implemented using a parallel set of traits located in the\n`dropbox_sdk::async_client_trait` module. A default implementation (which uses\n`reqwest` can be enabled with the `default_async_client` feature and is located\nat `dropbox_sdk::default_async_client`.\n\n## Authentication Types\n\nThe Dropbox API has a number of different [authentication types]. Each route\nrequires a HTTP client compatible with the specific authentication type needed.\nThe authentication type is designated by implementing a marker trait in\naddition to the base `HttpClient` trait: one of `NoauthClient`,\n`UserAuthClient`, `TeamAuthClient`, or `AppAuthClient`.\n\nThe default client has implementations of all of these. They all share a common\nimplementation and differ only in which HTTP headers they add to the request.\n\n[authentication types]: https://www.dropbox.com/developers/reference/auth-types\n\n## Feature Flags\n\nIf you only use a subset of the API, and you want to cut down on the compile\ntime, you can explicitly specify features corresponding to the namespaces you\nneed. For each namespace there is a corresponding feature `dbx_{whatever}`. The\nset of features can be updated if needed using the `update_manifest.py` script.\nAn example that only needs the 'files' and 'users' namespaces:\n```\n[dependencies.dropbox-sdk]\nversion = \"*\"\ndefault_features = false\nfeatures = [\"dbx_files\", \"dbx_users\"]\n```\n\n## Tests\n\nThe tests are auto-generated from the spec as well, but unlike the main code,\nare not checked in. Run `python generate.py` to generate the tests, and `cargo\ntest` to run them.\n\nThe test generator starts by generating a reference Python SDK and loading that\ncode. It then generates an instance of every type in the SDK and uses the\nPython code to serialize them to JSON. Then it emits Rust tests that contain\nthe JSON as a string, deserialize it, assert that all fields contain the\nexpected values, re-serialize it, deserialize it again, and assert the fields\nagain. Thus we have reasonably good coverage of the serialization and\ndeserialization logic that the Rust generator emits, checked against the Python\nimplementation (which is what Dropbox uses server-side).\n\n## Miscellaneous\n\nSome implementation notes, limitations, and TODOs:\n * Stone allows structures to inherit from other structures and be polymorphic.\n   Rust doesn't have these paradigms, so instead this SDK represents\n   polymorphic parent structs as enums, and the inherited fields are put in all\n   variants.  See `dropbox_sdk::files::Metadata` for an example. Upcasting is\n   supported using generated `From` implementations which either construct the\n   right enum variant or copy the subset of common fields.\n * This code does not use `serde_derive` for the most part, and instead uses\n   manually-emitted serialization code. Previous work on this crate did attempt\n   to use `serde_derive`, but the way the Dropbox API serializes unions\n   containing structs (by collapsing their fields into the union) isn't\n   supported by `serde_derive`. It also took an extremely long time to compile\n   (~30 minutes for release build) and huge (~190MB) .rlib files. The\n   hand-written code is more versatile, compiles faster, and produces a smaller\n   binary, at the expense of making the generated source code much larger.\n * Types with constraints (such as strings with patterns or min/max lengths, or\n   integers with a range) do not check that the data being stored in them meets\n   the constraints.\n * The sync routes and clients are actually implemented in terms of the async\n   client interfaces, but all the futures returned are `std::future::ready()`,\n   which is then removed using `now_or_never()` before being returned to\n   callers. Even though futures are passed around and async functions are used,\n   no executor is actually needed because of this.\n\n## Happy Dropboxing!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fdropbox-sdk-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropbox%2Fdropbox-sdk-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fdropbox-sdk-rust/lists"}