pub struct ContainerService { /* private fields */ }Expand description
Service for managing containers.
Implementations§
Source§impl ContainerService
impl ContainerService
Sourcepub async fn list(&self) -> Result<Vec<Container>, Error>
pub async fn list(&self) -> Result<Vec<Container>, Error>
List all containers for the authenticated user.
§Example
let client = RexecClient::new("https://example.com", "token");
let containers = client.containers().list().await?;
for c in containers {
println!("{}: {}", c.name, c.status);
}Sourcepub async fn create(
&self,
request: CreateContainerRequest,
) -> Result<Container, Error>
pub async fn create( &self, request: CreateContainerRequest, ) -> Result<Container, Error>
Create a new container.
§Example
let client = RexecClient::new("https://example.com", "token");
let container = client.containers()
.create(CreateContainerRequest::new("ubuntu:24.04")
.name("my-sandbox")
.env("MY_VAR", "value"))
.await?;Auto Trait Implementations§
impl !RefUnwindSafe for ContainerService
impl !UnwindSafe for ContainerService
impl Freeze for ContainerService
impl Send for ContainerService
impl Sync for ContainerService
impl Unpin for ContainerService
impl UnsafeUnpin for ContainerService
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