pub struct SandboxCreateOptions {Show 22 fields
pub image: String,
pub timeout_seconds: u64,
pub envs: BTreeMap<String, String>,
pub metadata: BTreeMap<String, String>,
pub name: Option<String>,
pub cpus: Option<u32>,
pub memory_mb: Option<u32>,
pub isolation: ExecutionIsolation,
pub rootfs_snapshot_id: Option<ExecutionSnapshotId>,
pub workspace: Option<PathBuf>,
pub workdir: Option<String>,
pub user: Option<String>,
pub hostname: Option<String>,
pub mounts: Vec<VolumeMount>,
pub tmpfs: Vec<TmpfsMount>,
pub network: SandboxNetwork,
pub ports: Vec<PortMapping>,
pub dns_servers: Vec<String>,
pub host_aliases: BTreeMap<String, String>,
pub read_only: bool,
pub persistent: bool,
pub auto_remove: bool,
}Expand description
Options for super::Sandbox::create_with_options.
MicroVM isolation is the default. Shared-kernel Sandbox isolation must be
selected explicitly with SandboxCreateOptions::isolation.
Fields§
§image: String§timeout_seconds: u64§envs: BTreeMap<String, String>§metadata: BTreeMap<String, String>§name: Option<String>§cpus: Option<u32>§memory_mb: Option<u32>§isolation: ExecutionIsolation§rootfs_snapshot_id: Option<ExecutionSnapshotId>§workspace: Option<PathBuf>§workdir: Option<String>§user: Option<String>§hostname: Option<String>§mounts: Vec<VolumeMount>§tmpfs: Vec<TmpfsMount>§network: SandboxNetwork§ports: Vec<PortMapping>§dns_servers: Vec<String>§host_aliases: BTreeMap<String, String>§read_only: bool§persistent: bool§auto_remove: boolImplementations§
Source§impl SandboxCreateOptions
impl SandboxCreateOptions
pub fn new(image: impl Into<String>) -> Self
pub const fn timeout_seconds(self, timeout_seconds: u64) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
pub const fn cpus(self, cpus: u32) -> Self
pub const fn memory_mb(self, memory_mb: u32) -> Self
pub const fn isolation(self, isolation: ExecutionIsolation) -> Self
Sourcepub fn filesystem_snapshot(self, snapshot_id: ExecutionSnapshotId) -> Self
pub fn filesystem_snapshot(self, snapshot_id: ExecutionSnapshotId) -> Self
Start from a runtime-managed immutable filesystem snapshot.
Snapshot identifiers are typed and validated by the runtime; callers cannot provide an arbitrary host path.
pub fn workspace(self, path: impl Into<PathBuf>) -> Self
pub fn workdir(self, path: impl Into<String>) -> Self
pub fn user(self, user: impl Into<String>) -> Self
pub fn hostname(self, hostname: impl Into<String>) -> Self
pub fn mount(self, mount: VolumeMount) -> Self
pub fn tmpfs(self, mount: TmpfsMount) -> Self
pub fn network(self, network: SandboxNetwork) -> Self
pub fn publish_port(self, port: PortMapping) -> Self
pub fn dns_server(self, server: impl Into<String>) -> Self
pub fn host_alias(self, host: impl Into<String>, ip: impl Into<String>) -> Self
pub const fn read_only(self, read_only: bool) -> Self
pub const fn persistent(self, persistent: bool) -> Self
pub const fn auto_remove(self, auto_remove: bool) -> Self
Trait Implementations§
Source§impl Clone for SandboxCreateOptions
impl Clone for SandboxCreateOptions
Source§fn clone(&self) -> SandboxCreateOptions
fn clone(&self) -> SandboxCreateOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SandboxCreateOptions
impl Debug for SandboxCreateOptions
Source§impl Default for SandboxCreateOptions
impl Default for SandboxCreateOptions
impl Eq for SandboxCreateOptions
Source§impl PartialEq for SandboxCreateOptions
impl PartialEq for SandboxCreateOptions
impl StructuralPartialEq for SandboxCreateOptions
Auto Trait Implementations§
impl Freeze for SandboxCreateOptions
impl RefUnwindSafe for SandboxCreateOptions
impl Send for SandboxCreateOptions
impl Sync for SandboxCreateOptions
impl Unpin for SandboxCreateOptions
impl UnsafeUnpin for SandboxCreateOptions
impl UnwindSafe for SandboxCreateOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more