Expand description
§Rexec Rust SDK
Official Rust SDK for Rexec — AI-native sandboxes.
§Quick Start
use rexec::{RexecClient, CreateSandboxRequest};
#[tokio::main]
async fn main() -> Result<(), rexec::Error> {
let client = RexecClient::new(
"https://rexec.sh",
"your-api-token"
);
// Create a sandbox (preferred). client.containers() still works.
let sandbox = client.sandboxes()
.create(CreateSandboxRequest::new("ubuntu").name("my-sandbox"))
.await?;
println!("Created sandbox: {}", sandbox.id);
let mut term = client.terminal().connect(&sandbox.id).await?;
term.write(b"echo hello\n").await?;
client.sandboxes().delete(&sandbox.id).await?;
Ok(())
}Structs§
- Create
Sandbox Request - Request to create a new sandbox. Prefer image aliases (e.g.
ubuntu). - File
Info - File or directory metadata.
- File
Service - Service for file operations in containers.
- Resize
Message - Terminal resize message.
- Rexec
Client - Main client for interacting with Rexec API.
- Sandbox
- Represents a Rexec sandbox (isolated Linux environment).
- Sandbox
Service - Service for managing sandboxes.
- Terminal
- WebSocket terminal connection to a container.
- Terminal
Service - Service for terminal WebSocket connections.
Enums§
- Error
- Error types for Rexec SDK.
- Sandbox
Status - Sandbox status values (string form also used on the wire).
Type Aliases§
- Container
Deprecated - Deprecated alias for
Sandbox. - Container
Service Deprecated - Deprecated alias for
SandboxService. - Container
Status Deprecated - Deprecated alias for
SandboxStatus. - Create
Container Request Deprecated - Deprecated alias for
CreateSandboxRequest.