
Compatibility Points
When talking about compatibility for the Ditto Rust SDK, there are a few properties that we need to check in order to ensure that we can deploy a Ditto-powered app to a device. These properties are:- The Target triple of the device where the app will be deployed,
- The Ditto SDK version the app depends on, and
- The Rust toolchain version used to compile the app
Supported Targets
Compilers use terms known as “target triples” to describe the architecture, operating system, and additional details about a system to compile programs for. The following targets are officially supported by the Ditto Rust SDK:Architecture | Operating System | Target Triples |
---|---|---|
Intel Core (x86_64) | macOS (11+) | x86_64-apple-darwin |
Linux | x86_64-unknown-linux-gnu | |
ARM 64-bit (aarch64) | macOS | aarch64-apple-darwin |
Linux | aarch64-unknown-linux-gnu |
Checking the target triple
Before getting started with development, it’s nice to check for certain that the device you’re working with actually has the target triple you think it should. Fortunately, Rust provides an easy way to check what the exact target triple for a device is. This easy method requires installing Rust on the target machine (the one where the app will be deployed), then running the command rustc -vV to check the compiler version information. For example, from an M1 Macbook Pro, we see an output like this:shell
Here, the field labeled “host” describes the target triple of the machine where we ran this command, in this case our target triple is aarch64-apple-darwin.
Matching the SDK and Rust Toolchain versions
The Ditto Rust SDK is slightly different from most Rust libraries because it has strict requirements on the Rust toolchain version that must be used to compile it. We’re working to relax this requirement, but for now what you need to know is that when you import a given Ditto SDK version, you must use the exact matching Rust toolchain version as shown below:Ditto SDK version | Rust Toolchain version |
---|---|
”=4.12.x” | 1.85.0 |
”=4.11.x” | 1.85.0 |
”=4.10.x” | 1.81.0 |
”=4.9.x” | 1.81.0 |
”=4.8.x” | 1.76.0 |
”=4.6.x” - “=4.7.x” | 1.74.1 |
”=4.0.x” - “=4.5.x” | 1.66.1 |
”=3.x.y” | 1.64.0 |
Cargo.toml
Selecting a Toolchain for your project
The easiest way to choose a specific toolchain version for a project is to create a file called rust-toolchain in your project directory (next to the Cargo.toml). For example, when using the 4.7.1 SDK, set the 1.74.1 toolchain like this:./rust-toolchain
shell
Transports
Some platforms do not support all of the types of transports that Ditto provides in general. Here is a table of which platforms support which transports, which you can use to help plan out your application.Platform | BLE 5.0+ | AWDL | Wi-Fi Aware | LAN | WebSockets |
---|---|---|---|---|---|
Linux (x64) | — | — | |||
Linux (AArch64) | — | — | |||
macOS | — | — | |||
Windows | — | — | — |