pub struct SandboxService { /* private fields */ }Expand description
Service for managing sandboxes.
Implementations§
Source§impl SandboxService
impl SandboxService
Sourcepub async fn list(&self) -> Result<Vec<Sandbox>, Error>
pub async fn list(&self) -> Result<Vec<Sandbox>, Error>
List all containers for the authenticated user.
§Example
let client = RexecClient::new("https://example.com", "token");
let containers = client.sandboxes().list().await?;
for c in containers {
println!("{}: {}", c.name, c.status);
}Sourcepub async fn create(
&self,
request: CreateSandboxRequest,
) -> Result<Sandbox, Error>
pub async fn create( &self, request: CreateSandboxRequest, ) -> Result<Sandbox, Error>
Create a new container.
§Example
let client = RexecClient::new("https://example.com", "token");
let container = client.sandboxes()
.create(CreateSandboxRequest::new("ubuntu")
.name("my-sandbox")
.env("MY_VAR", "value"))
.await?;Auto Trait Implementations§
impl !RefUnwindSafe for SandboxService
impl !UnwindSafe for SandboxService
impl Freeze for SandboxService
impl Send for SandboxService
impl Sync for SandboxService
impl Unpin for SandboxService
impl UnsafeUnpin for SandboxService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more