pub struct Sandbox { /* private fields */ }Expand description
A live sandbox handle. Exposes the core namespaces.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn control_url(&self) -> &str
pub fn control_url(&self) -> &str
The control-WS URL.
Sourcepub fn stream_url(&self) -> Option<&str>
pub fn stream_url(&self) -> Option<&str>
The live-view stream URL. Some for desktops only — a headless sandbox
has no display, so the gateway omits it.
Sourcepub fn expires_at(&self) -> &str
pub fn expires_at(&self) -> &str
ISO-8601 expiry timestamp.
Sourcepub async fn connect(&self) -> Result<(), SolariError>
pub async fn connect(&self) -> Result<(), SolariError>
Open the control WebSocket. Idempotent.
Sourcepub async fn pause(&self) -> Result<(), SolariError>
pub async fn pause(&self) -> Result<(), SolariError>
Pause this session: snapshot its RAM+disk, free its host slot, and close
the control channel. The session keeps its id; bring it back with
Sandbox::resume.
Mirrors TS handle.pause() / Python handle.pause(): remote call first,
then the local channel close.
Sourcepub async fn resume(&mut self) -> Result<(), SolariError>
pub async fn resume(&mut self) -> Result<(), SolariError>
Resume this paused session and re-point the control channel at the fresh slot it came back on.
Mirrors TS handle.resume() / Python handle.resume(): resume, adopt the
new control URL, reconnect.
Takes &mut self where the rest of the handle takes &self: resuming
genuinely replaces this handle’s control_url, and Sandbox::control_url
hands out a borrow of it. Interior mutability would let that borrow go
stale behind the caller’s back — the compiler should be the one saying
this call mutates the handle.
Sourcepub async fn start(&mut self) -> Result<(), SolariError>
pub async fn start(&mut self) -> Result<(), SolariError>
Cold-boot this STOPPED session from its kept disk and re-point the control
channel at the fresh control URL. Processes and memory are gone, files on
disk are kept. See Client::start for the refusal codes.
Takes &mut self for the same reason as Sandbox::resume: it replaces
this handle’s control_url.
Sourcepub async fn kill(&self) -> Result<(), SolariError>
pub async fn kill(&self) -> Result<(), SolariError>
Destroy the remote session and close the channel. Idempotent.