Skip to main content

Crate exedev

Crate exedev 

Source
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).

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 blocking feature, BlockOn::block_on runs 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.
ClientBuilder
Configures a Client.
CommandResult
How a command run on a VM ended, and what it wrote.
Logs
A process’s output so far; see Process::logs.
LogsRequest
Process::logs.
Process
A process that Vm::spawn started on a VM.
Run
Vm::run: a command to run on a VM.
SignToken
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.
WaitUntilReady
Vm::wait_until_ready.
WriteFile
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.
WaitUntil
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.