pub struct Sandbox {
pub id: String,
pub name: String,
pub commands: Commands,
pub files: Files,
/* private fields */
}Expand description
A handle to one sandbox, deleted when dropped (see Sandbox::detach).
Fields§
§id: StringThe short ID (8 hex characters).
name: StringThe full resource name.
commands: CommandsRuns commands in the sandbox.
files: FilesReads and writes the sandbox’s filesystem.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn create(o: CreateOptions) -> Result<Sandbox>
pub fn create(o: CreateOptions) -> Result<Sandbox>
See crate::Sandbox::create. The sandbox is deleted when the handle is dropped.
Sourcepub fn connect(id: &str, o: ConnectOptions) -> Result<Sandbox>
pub fn connect(id: &str, o: ConnectOptions) -> Result<Sandbox>
See crate::Sandbox::connect. A connected sandbox is not deleted on drop.
Sourcepub fn detach(self) -> Sandbox
pub fn detach(self) -> Sandbox
Keeps the sandbox running after the handle is dropped. Returns the async handle.
Sourcepub fn kill(&self) -> Result<bool>
pub fn kill(&self) -> Result<bool>
See crate::Sandbox::kill.
Sourcepub fn keep_alive(&self, d: Duration) -> Result<()>
pub fn keep_alive(&self, d: Duration) -> Result<()>
Sourcepub fn is_running(&self) -> Result<bool>
pub fn is_running(&self) -> Result<bool>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sandbox
impl !RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
impl !UnwindSafe 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].