pub struct SandboxBuilder<I> { /* private fields */ }Expand description
Builder for Sandbox configuration
§Required fields:
name: The name of the sandboximage: The image to use
§Optional fields:
version: The version of the sandboxmeta: The metadata for the sandboxmemory: The maximum amount of memory allowed for the sandboxcpus: The maximum number of CPUs allowed for the sandboxvolumes: The volumes to mountports: The ports to exposeenvs: The environment variables to useenv_file: The environment file to usegroups: The groups to run the sandbox independs_on: The sandboxes to depend onworkdir: The working directory to useshell: The shell to usescripts: The scripts available in the sandboximports: The files to importexports: The files to exportscope: The network scope for the sandboxproxy: The proxy to use
Implementations§
Source§impl<I> SandboxBuilder<I>
impl<I> SandboxBuilder<I>
Sourcepub fn version(self, version: impl Into<Version>) -> SandboxBuilder<I>
pub fn version(self, version: impl Into<Version>) -> SandboxBuilder<I>
Sets the version of the sandbox
Sourcepub fn meta(self, meta: Meta) -> SandboxBuilder<I>
pub fn meta(self, meta: Meta) -> SandboxBuilder<I>
Sets the metadata for the sandbox
Sourcepub fn image(
self,
image: impl Into<ReferenceOrPath>,
) -> SandboxBuilder<ReferenceOrPath>
pub fn image( self, image: impl Into<ReferenceOrPath>, ) -> SandboxBuilder<ReferenceOrPath>
Sets the image for the sandbox
Sourcepub fn memory(self, memory: u32) -> SandboxBuilder<I>
pub fn memory(self, memory: u32) -> SandboxBuilder<I>
Sets the maximum amount of memory allowed for the sandbox
Sourcepub fn cpus(self, cpus: u8) -> SandboxBuilder<I>
pub fn cpus(self, cpus: u8) -> SandboxBuilder<I>
Sets the maximum number of CPUs allowed for the sandbox
Sourcepub fn volumes(
self,
volumes: impl IntoIterator<Item = PathPair>,
) -> SandboxBuilder<I>
pub fn volumes( self, volumes: impl IntoIterator<Item = PathPair>, ) -> SandboxBuilder<I>
Sets the volumes to mount for the sandbox
Sourcepub fn ports(
self,
ports: impl IntoIterator<Item = PortPair>,
) -> SandboxBuilder<I>
pub fn ports( self, ports: impl IntoIterator<Item = PortPair>, ) -> SandboxBuilder<I>
Sets the ports to expose for the sandbox
Sourcepub fn envs(self, envs: impl IntoIterator<Item = EnvPair>) -> SandboxBuilder<I>
pub fn envs(self, envs: impl IntoIterator<Item = EnvPair>) -> SandboxBuilder<I>
Sets the environment variables for the sandbox
Sourcepub fn env_file(self, env_file: impl Into<Utf8UnixPathBuf>) -> SandboxBuilder<I>
pub fn env_file(self, env_file: impl Into<Utf8UnixPathBuf>) -> SandboxBuilder<I>
Sets the environment file for the sandbox
Sourcepub fn groups(
self,
groups: impl IntoIterator<Item = (String, SandboxGroup)>,
) -> SandboxBuilder<I>
pub fn groups( self, groups: impl IntoIterator<Item = (String, SandboxGroup)>, ) -> SandboxBuilder<I>
Sets the groups for the sandbox
Sourcepub fn depends_on(
self,
depends_on: impl IntoIterator<Item = String>,
) -> SandboxBuilder<I>
pub fn depends_on( self, depends_on: impl IntoIterator<Item = String>, ) -> SandboxBuilder<I>
Sets the sandboxes that the sandbox depends on
Sourcepub fn workdir(self, workdir: impl Into<Utf8UnixPathBuf>) -> SandboxBuilder<I>
pub fn workdir(self, workdir: impl Into<Utf8UnixPathBuf>) -> SandboxBuilder<I>
Sets the working directory for the sandbox
Sourcepub fn shell(self, shell: impl AsRef<str>) -> SandboxBuilder<I>
pub fn shell(self, shell: impl AsRef<str>) -> SandboxBuilder<I>
Sets the shell for the sandbox
Sourcepub fn scripts(
self,
scripts: impl IntoIterator<Item = (String, String)>,
) -> SandboxBuilder<I>
pub fn scripts( self, scripts: impl IntoIterator<Item = (String, String)>, ) -> SandboxBuilder<I>
Sets the scripts for the sandbox
Sourcepub fn command(
self,
command: impl IntoIterator<Item = String>,
) -> SandboxBuilder<I>
pub fn command( self, command: impl IntoIterator<Item = String>, ) -> SandboxBuilder<I>
Sets the command for the sandbox
Sourcepub fn imports(
self,
imports: impl IntoIterator<Item = (String, Utf8UnixPathBuf)>,
) -> SandboxBuilder<I>
pub fn imports( self, imports: impl IntoIterator<Item = (String, Utf8UnixPathBuf)>, ) -> SandboxBuilder<I>
Sets the files to import for the sandbox
Sourcepub fn exports(
self,
exports: impl IntoIterator<Item = (String, Utf8UnixPathBuf)>,
) -> SandboxBuilder<I>
pub fn exports( self, exports: impl IntoIterator<Item = (String, Utf8UnixPathBuf)>, ) -> SandboxBuilder<I>
Sets the files to export for the sandbox
Sourcepub fn scope(self, scope: NetworkScope) -> SandboxBuilder<I>
pub fn scope(self, scope: NetworkScope) -> SandboxBuilder<I>
Sets the network scope for the sandbox
Trait Implementations§
Auto Trait Implementations§
impl<I> Freeze for SandboxBuilder<I>where
I: Freeze,
impl<I> RefUnwindSafe for SandboxBuilder<I>where
I: RefUnwindSafe,
impl<I> Send for SandboxBuilder<I>where
I: Send,
impl<I> Sync for SandboxBuilder<I>where
I: Sync,
impl<I> Unpin for SandboxBuilder<I>where
I: Unpin,
impl<I> UnwindSafe for SandboxBuilder<I>where
I: UnwindSafe,
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
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