rexec/lib.rs
1//! # Rexec Rust SDK
2//!
3//! Official Rust SDK for [Rexec](https://github.com/PipeOpsHQ/rexec) — AI-native sandboxes.
4//!
5//! ## Quick Start
6//!
7//! ```rust,no_run
8//! use rexec::{RexecClient, CreateSandboxRequest};
9//!
10//! #[tokio::main]
11//! async fn main() -> Result<(), rexec::Error> {
12//! let client = RexecClient::new(
13//! "https://rexec.sh",
14//! "your-api-token"
15//! );
16//!
17//! // Create a sandbox (preferred). client.containers() still works.
18//! let sandbox = client.sandboxes()
19//! .create(CreateSandboxRequest::new("ubuntu").name("my-sandbox"))
20//! .await?;
21//!
22//! println!("Created sandbox: {}", sandbox.id);
23//!
24//! let mut term = client.terminal().connect(&sandbox.id).await?;
25//! term.write(b"echo hello\n").await?;
26//!
27//! client.sandboxes().delete(&sandbox.id).await?;
28//!
29//! Ok(())
30//! }
31//! ```
32
33mod client;
34mod containers;
35mod error;
36mod files;
37mod terminal;
38mod types;
39
40pub use client::RexecClient;
41pub use containers::SandboxService;
42#[allow(deprecated)]
43pub use containers::ContainerService;
44pub use error::Error;
45pub use files::FileService;
46pub use terminal::{Terminal, TerminalService};
47#[allow(deprecated)]
48pub use types::*;