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 recording_url(&self) -> Option<&str>
pub fn recording_url(&self) -> Option<&str>
The session recording link, when the create asked for a recording.
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.
pub fn commands(&self) -> Commands<'_>
pub fn files(&self) -> Files<'_>
pub fn code(&self) -> Code<'_>
pub fn git(&self) -> Git<'_>
Trait Implementations§
Source§impl GitRunner for Sandbox
Sandbox runs git through commands.run("git", …) (no shell).
impl GitRunner for Sandbox
Sandbox runs git through commands.run("git", …) (no shell).
fn run_git<'a>( &'a self, args: Vec<String>, cwd: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<CommandResult, SolariError>> + Send + 'a>>
Source§fn run_git_env<'a>(
&'a self,
args: Vec<String>,
cwd: Option<String>,
env: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<CommandResult, SolariError>> + Send + 'a>>
fn run_git_env<'a>( &'a self, args: Vec<String>, cwd: Option<String>, env: Option<HashMap<String, String>>, ) -> Pin<Box<dyn Future<Output = Result<CommandResult, SolariError>> + Send + 'a>>
run_git with environment variables for the command (used to hand credentials to
git). The default refuses rather than dropping them: a runner that cannot pass an environment must not run an
authenticated command as an unauthenticated one.