pub struct UninitializedSandbox { /* private fields */ }Expand description
A preliminary Sandbox, not yet ready to execute guest code.
Prior to initializing a full-fledged Sandbox, you must create one of
these UninitializedSandboxes with the new function, register all the
host-implemented functions you need to be available to the guest, then
call evolve to transform your
UninitializedSandbox into an initialized Sandbox.
Implementations§
Source§impl UninitializedSandbox
impl UninitializedSandbox
Sourcepub fn new(
guest_binary: GuestBinary,
cfg: Option<SandboxConfiguration>,
sandbox_run_options: Option<SandboxRunOptions>,
host_print_writer: Option<&dyn HostFunction1<'_, String, i32>>,
) -> Result<Self>
pub fn new( guest_binary: GuestBinary, cfg: Option<SandboxConfiguration>, sandbox_run_options: Option<SandboxRunOptions>, host_print_writer: Option<&dyn HostFunction1<'_, String, i32>>, ) -> Result<Self>
Create a new sandbox configured to run the binary at path
bin_path.
The instrument attribute is used to generate tracing spans and also to emit an error should the Result be an error.
The skip attribute is used to skip the guest binary from being printed in the tracing span.
The name attribute is used to name the tracing span.
The err attribute is used to emit an error should the Result be an error, it uses the std::fmt::Debug trait to print the error.
Trait Implementations§
Source§impl Debug for UninitializedSandbox
impl Debug for UninitializedSandbox
Source§impl EvolvableSandbox<UninitializedSandbox, MultiUseSandbox, Noop<UninitializedSandbox, MultiUseSandbox>> for UninitializedSandbox
impl EvolvableSandbox<UninitializedSandbox, MultiUseSandbox, Noop<UninitializedSandbox, MultiUseSandbox>> for UninitializedSandbox
Source§fn evolve(
self,
_: Noop<UninitializedSandbox, MultiUseSandbox>,
) -> Result<MultiUseSandbox>
fn evolve( self, _: Noop<UninitializedSandbox, MultiUseSandbox>, ) -> Result<MultiUseSandbox>
Evolve self to a MultiUseSandbox without any additional metadata.