sail-rs
The official Rust SDK for Sail. Create and drive sailboxes, sandboxed cloud VMs, from Rust: lifecycle, streaming exec, file transfer, and ingress.
This crate is the canonical core that the Sail Python SDK and the sail CLI are
both built on, so the Rust API is the source of truth for behavior.
[]
= "0.2"
The crate is published as sail-rs and imported as sail:
use Client;
Adding the crate does not install the sail CLI (a library crate cannot ship a
companion binary). Install the CLI separately:
|
Quickstart
The client reads its API key from SAIL_API_KEY (falling back to the credential
stored under ~/.sail), the same configuration the CLI uses.
use ExecOptions;
use Client;
async
Runtime
Every method is async. The client is meant to be driven on a Tokio runtime:
- Async hosts await the methods directly on their own runtime. Streaming
operations (
exec,download_file,upload_file) spawn their background pump on the calling task's runtime, so call them from within one. - Synchronous code can drive any method with [
sail::block_on], which runs it to completion on a shared internal runtime. Do not callblock_onfrom inside an existing runtime; await the method instead.
[Client] is cheap to clone (it shares its connection pools and config behind an
Arc), so clone it to share across tasks. Use one client per runtime.
Sail in other languages
- Python:
pip install sail-sdk(this crate compiled as a native extension). - CLI: the
sailcommand, built on this crate.
Stability
The public API is everything documented here. Items hidden from this
documentation (including the internal module) back the first-party bindings and
are not part of the public API.
License
Licensed under the Apache License, Version 2.0.