Install snapdir for Rust
Rust is snapdir's native home: the binding is snapdir-api, the stable async
facade over snapdir-core that every other binding wraps through the C ABI.
Because it is a plain crate published to crates.io, cargo compiles it from
source like any dependency — no cbindgen, no C toolchain, no post-install
step. You get the same BLAKE3 walk, manifests, and 64-character snapshot IDs as
the CLI.
Install
Add the snapdir-api crate to your
project. The distribution operations (push, pull, fetch, diff, sync)
are async, so pair it with an async runtime such as
Tokio:
cargo add snapdir-api
cargo add tokio --features full # async runtime for push/pull/fetch/diff/sync
That is the whole install: cargo build compiles the crate from source the
same way it does any dependency. There is no native blob to vendor and no
snapdir-ffi build step — that C ABI recipe is only for the C/C++, Zig, and Go
bindings, which wrap this same crate through its C surface. If you need that C
ABI directly (for your own FFI), add it with cargo add snapdir-ffi.
The sync operations — id, manifest, id_from_manifest, stage — need no
runtime and can be called from ordinary synchronous code.
Platform support
Every binding runs on Linux (glibc and Alpine/musl, x64 and arm64) and macOS; Windows is unsupported, since snapdir is Unix-only.
The one binding-wide exception is Java, which is glibc-only today (musl support is planned for 1.11.1). The Rust binding has no such caveat — it builds and links on glibc and musl alike.
Next
- Rust quickstart — a 60-second push → pull round-trip.
- snapdir for Rust — the full binding reference.