pub struct Sandbox { /* private fields */ }Expand description
The sandbox to run.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn get_version(&self) -> &Option<Version>
pub fn get_version(&self) -> &Option<Version>
The version of the sandbox.
Sourcepub fn get_image(&self) -> &ReferenceOrPath
pub fn get_image(&self) -> &ReferenceOrPath
The image to use. This can be a path to a local rootfs or an OCI image reference.
Sourcepub fn get_memory(&self) -> &Option<u32>
pub fn get_memory(&self) -> &Option<u32>
The amount of memory in MiB to use.
Sourcepub fn get_volumes(&self) -> &Vec<PathPair>
pub fn get_volumes(&self) -> &Vec<PathPair>
The volumes to mount.
Sourcepub fn get_groups(&self) -> &HashMap<String, SandboxGroup>
pub fn get_groups(&self) -> &HashMap<String, SandboxGroup>
The groups to run in.
Sourcepub fn get_depends_on(&self) -> &Vec<String>
pub fn get_depends_on(&self) -> &Vec<String>
The sandboxes to depend on.
Sourcepub fn get_workdir(&self) -> &Option<Utf8UnixPathBuf>
pub fn get_workdir(&self) -> &Option<Utf8UnixPathBuf>
The working directory to use.
Sourcepub fn get_scripts(&self) -> &HashMap<String, String>
pub fn get_scripts(&self) -> &HashMap<String, String>
The scripts that can be run.
Sourcepub fn get_command(&self) -> &Vec<String>
pub fn get_command(&self) -> &Vec<String>
The command to run. This is a list of command and arguments.
Sourcepub fn get_imports(&self) -> &HashMap<String, Utf8UnixPathBuf>
pub fn get_imports(&self) -> &HashMap<String, Utf8UnixPathBuf>
The files to import.
Sourcepub fn get_exports(&self) -> &HashMap<String, Utf8UnixPathBuf>
pub fn get_exports(&self) -> &HashMap<String, Utf8UnixPathBuf>
The artifacts produced by the sandbox.
Sourcepub fn get_scope(&self) -> &NetworkScope
pub fn get_scope(&self) -> &NetworkScope
The network scope for the sandbox.
Source§impl Sandbox
impl Sandbox
Sourcepub fn set_version(&mut self, val: Option<Version>) -> &mut Self
pub fn set_version(&mut self, val: Option<Version>) -> &mut Self
The version of the sandbox.
Sourcepub fn set_image(&mut self, val: ReferenceOrPath) -> &mut Self
pub fn set_image(&mut self, val: ReferenceOrPath) -> &mut Self
The image to use. This can be a path to a local rootfs or an OCI image reference.
Sourcepub fn set_memory(&mut self, val: Option<u32>) -> &mut Self
pub fn set_memory(&mut self, val: Option<u32>) -> &mut Self
The amount of memory in MiB to use.
Sourcepub fn set_volumes(&mut self, val: Vec<PathPair>) -> &mut Self
pub fn set_volumes(&mut self, val: Vec<PathPair>) -> &mut Self
The volumes to mount.
Sourcepub fn set_groups(&mut self, val: HashMap<String, SandboxGroup>) -> &mut Self
pub fn set_groups(&mut self, val: HashMap<String, SandboxGroup>) -> &mut Self
The groups to run in.
Sourcepub fn set_depends_on(&mut self, val: Vec<String>) -> &mut Self
pub fn set_depends_on(&mut self, val: Vec<String>) -> &mut Self
The sandboxes to depend on.
Sourcepub fn set_workdir(&mut self, val: Option<Utf8UnixPathBuf>) -> &mut Self
pub fn set_workdir(&mut self, val: Option<Utf8UnixPathBuf>) -> &mut Self
The working directory to use.
Sourcepub fn set_scripts(&mut self, val: HashMap<String, String>) -> &mut Self
pub fn set_scripts(&mut self, val: HashMap<String, String>) -> &mut Self
The scripts that can be run.
Sourcepub fn set_command(&mut self, val: Vec<String>) -> &mut Self
pub fn set_command(&mut self, val: Vec<String>) -> &mut Self
The command to run. This is a list of command and arguments.
Sourcepub fn set_imports(
&mut self,
val: HashMap<String, Utf8UnixPathBuf>,
) -> &mut Self
pub fn set_imports( &mut self, val: HashMap<String, Utf8UnixPathBuf>, ) -> &mut Self
The files to import.
Sourcepub fn set_exports(
&mut self,
val: HashMap<String, Utf8UnixPathBuf>,
) -> &mut Self
pub fn set_exports( &mut self, val: HashMap<String, Utf8UnixPathBuf>, ) -> &mut Self
The artifacts produced by the sandbox.
Sourcepub fn set_scope(&mut self, val: NetworkScope) -> &mut Self
pub fn set_scope(&mut self, val: NetworkScope) -> &mut Self
The network scope for the sandbox.
Source§impl Sandbox
impl Sandbox
Sourcepub fn builder() -> SandboxBuilder<()>
pub fn builder() -> SandboxBuilder<()>
Returns a builder for the sandbox.
See SandboxBuilder for options.
Sourcepub fn validate(&self) -> MicrosandboxResult<()>
pub fn validate(&self) -> MicrosandboxResult<()>
Validates the configuration.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sandbox
impl<'de> Deserialize<'de> for Sandbox
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Sandbox
Auto Trait Implementations§
impl Freeze for Sandbox
impl RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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