pub struct Sandbox { /* private fields */ }Implementations§
Source§impl Sandbox
impl Sandbox
pub fn sandbox_id(&self) -> &str
pub fn commands(&self) -> &Commands
pub fn files(&self) -> &Files
pub fn client(&self) -> &HeyoClient
Sourcepub async fn create(
options: SandboxCreateOptions,
client_options: HeyoClientOptions,
) -> Result<Self, HeyoError>
pub async fn create( options: SandboxCreateOptions, client_options: HeyoClientOptions, ) -> Result<Self, HeyoError>
Create a new sandbox and (by default) wait for it to leave the
provisioning state before returning.
Set options.wait_for_ready = Some(Duration::ZERO) to return
immediately and wait_for_ready() later.
Sourcepub fn connect(
sandbox_id: String,
client_options: HeyoClientOptions,
) -> Result<Self, HeyoError>
pub fn connect( sandbox_id: String, client_options: HeyoClientOptions, ) -> Result<Self, HeyoError>
Reattach to an existing sandbox by ID. Issues no network call.
Sourcepub async fn list(
client_options: HeyoClientOptions,
) -> Result<Vec<SandboxInfo>, HeyoError>
pub async fn list( client_options: HeyoClientOptions, ) -> Result<Vec<SandboxInfo>, HeyoError>
List all deployed sandboxes the caller can see.
Sourcepub async fn list_public_images(
backend: Option<&str>,
client_options: HeyoClientOptions,
) -> Result<Vec<PublicImage>, HeyoError>
pub async fn list_public_images( backend: Option<&str>, client_options: HeyoClientOptions, ) -> Result<Vec<PublicImage>, HeyoError>
List public images available to deploy.
Sourcepub async fn info(&self) -> Result<SandboxInfo, HeyoError>
pub async fn info(&self) -> Result<SandboxInfo, HeyoError>
Fetch the latest info for this sandbox.
Sourcepub async fn wait_for_ready(
&self,
timeout: Duration,
) -> Result<SandboxInfo, HeyoError>
pub async fn wait_for_ready( &self, timeout: Duration, ) -> Result<SandboxInfo, HeyoError>
Block until the sandbox transitions out of provisioning.
Sourcepub async fn kill(&self) -> Result<(), HeyoError>
pub async fn kill(&self) -> Result<(), HeyoError>
Permanently delete this sandbox. 404 is treated as success.
pub async fn stop(&self) -> Result<(), HeyoError>
pub async fn start(&self) -> Result<(), HeyoError>
pub async fn restart(&self) -> Result<(), HeyoError>
Sourcepub async fn set_ttl(&self, ttl_seconds: u64) -> Result<(), HeyoError>
pub async fn set_ttl(&self, ttl_seconds: u64) -> Result<(), HeyoError>
Update the sandbox’s TTL (seconds). 0 for unlimited (if plan allows).
pub async fn resize(&self, size: SandboxSize) -> Result<(), HeyoError>
pub async fn checkpoint(&self) -> Result<(), HeyoError>
pub async fn restore(&self) -> Result<(), HeyoError>
pub async fn replace_mount( &self, archive_id: &str, sandbox_path: Option<&str>, ) -> Result<(), HeyoError>
Sourcepub async fn get_host(&self, port: u16) -> Result<Option<String>, HeyoError>
pub async fn get_host(&self, port: u16) -> Result<Option<String>, HeyoError>
Public URL for a port the sandbox has bound, or None if not exposed.
Sourcepub async fn shell(
&self,
options: ShellOptions,
) -> Result<ShellSession, HeyoError>
pub async fn shell( &self, options: ShellOptions, ) -> Result<ShellSession, HeyoError>
Open a persistent interactive shell. The returned ShellSession
is already past the init/ready handshake.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sandbox
impl !UnwindSafe for Sandbox
impl Freeze for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
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