Expand description
The exe.dev SDK: create VMs, run commands on them, and run every exe.dev command, from Rust.
// EXE_TOKEN holds an API key.
let exe = exedev::Client::from_env()?;
let vm = exe.new_vm().await?;
let result = vm.run("uname -a").check(true).await?;
print!("{}", result.stdout_lossy());
vm.delete().await?;Methods return request builders: set options with their methods, then
.await them. A builder does nothing until it is awaited. Command groups
are namespaces: exe.team().members(), vm.share().port(8000).
Clientruns commands for your account:Client::new_vm,Client::vms,Client::vm, and the rest incmd.Vmis a VM:Vm::runruns a command on it;Vm::write_file,Vm::read_file,Vm::uploadandVm::downloadmove files;Vm::spawnstarts aProcessthat outlives the connection.typesare the JSON results of commands, as Rust types.- Every error is an
Error.
The SDK uses Tokio. With the blocking feature, blocking::BlockOn
runs requests from synchronous code.
Re-exports§
pub use error::Error;pub use error::Result;pub use types::EgressPolicy;
Modules§
- blocking
- Blocking calls, for programs without an async runtime: with the
blockingfeature,BlockOn::block_onruns any of the SDK’s requests to completion on a runtime the SDK starts once and shares. - cmd
- Requests for exe.dev’s commands.
- error
- Errors. Every error the SDK returns is an
Error. - types
- The JSON exe.dev returns, as Rust types.
Structs§
- Client
- An exe.dev API client.
- Client
Builder - Configures a
Client. - Command
Result - How a command run on a VM ended, and what it wrote.
- Logs
- A process’s output so far; see
Process::logs. - Logs
Request Process::logs.- Process
- A process that
Vm::spawnstarted on a VM. - Run
Vm::run: a command to run on a VM.- Sign
Token sign_token: a token to sign.- Spawn
Vm::spawn: a command to start in the background.- Upload
Vm::upload: a local file or directory to copy to a VM.- Vm
- A VM on exe.dev.
- Vms
Client::vms: your VMs.- Wait
Process::wait.- Wait
Until Ready Vm::wait_until_ready.- Write
File Vm::write_file: a file to write.
Enums§
- Command
- A command to run on a VM: a shell command line, or an argument list, which is quoted for you.
- Stream
- Which output stream.
- Wait
Until - What to wait for after creating, copying, or starting a VM.
Constants§
- MAX_
OUTPUT - The default limit on captured output.
- VERSION
- The SDK’s version, from its Cargo.toml.
Functions§
- quote
- Quotes s as one POSIX shell word, as Python’s shlex.quote does: for
untrusted values put into a command line,
vm.run(format!("cat {}", exedev::quote(path))). - sign_
token - Makes an exe0 API token locally, without a request.
Type Aliases§
- BoxFuture
- A boxed future, as the SDK’s request builders resolve to.