Struct SandboxBuilder

Source
pub struct SandboxBuilder<I> { /* private fields */ }
Expand description

Builder for Sandbox configuration

§Required fields:

  • name: The name of the sandbox
  • image: The image to use

§Optional fields:

  • version: The version of the sandbox
  • meta: The metadata for the sandbox
  • memory: The maximum amount of memory allowed for the sandbox
  • cpus: The maximum number of CPUs allowed for the sandbox
  • volumes: The volumes to mount
  • ports: The ports to expose
  • envs: The environment variables to use
  • env_file: The environment file to use
  • groups: The groups to run the sandbox in
  • depends_on: The sandboxes to depend on
  • workdir: The working directory to use
  • shell: The shell to use
  • scripts: The scripts available in the sandbox
  • imports: The files to import
  • exports: The files to export
  • scope: The network scope for the sandbox
  • proxy: The proxy to use

Implementations§

Source§

impl<I> SandboxBuilder<I>

Source

pub fn version(self, version: impl Into<Version>) -> SandboxBuilder<I>

Sets the version of the sandbox

Source

pub fn meta(self, meta: Meta) -> SandboxBuilder<I>

Sets the metadata for the sandbox

Source

pub fn image( self, image: impl Into<ReferenceOrPath>, ) -> SandboxBuilder<ReferenceOrPath>

Sets the image for the sandbox

Source

pub fn memory(self, memory: u32) -> SandboxBuilder<I>

Sets the maximum amount of memory allowed for the sandbox

Source

pub fn cpus(self, cpus: u8) -> SandboxBuilder<I>

Sets the maximum number of CPUs allowed for the sandbox

Source

pub fn volumes( self, volumes: impl IntoIterator<Item = PathPair>, ) -> SandboxBuilder<I>

Sets the volumes to mount for the sandbox

Source

pub fn ports( self, ports: impl IntoIterator<Item = PortPair>, ) -> SandboxBuilder<I>

Sets the ports to expose for the sandbox

Source

pub fn envs(self, envs: impl IntoIterator<Item = EnvPair>) -> SandboxBuilder<I>

Sets the environment variables for the sandbox

Source

pub fn env_file(self, env_file: impl Into<Utf8UnixPathBuf>) -> SandboxBuilder<I>

Sets the environment file for the sandbox

Source

pub fn groups( self, groups: impl IntoIterator<Item = (String, SandboxGroup)>, ) -> SandboxBuilder<I>

Sets the groups for the sandbox

Source

pub fn depends_on( self, depends_on: impl IntoIterator<Item = String>, ) -> SandboxBuilder<I>

Sets the sandboxes that the sandbox depends on

Source

pub fn workdir(self, workdir: impl Into<Utf8UnixPathBuf>) -> SandboxBuilder<I>

Sets the working directory for the sandbox

Source

pub fn shell(self, shell: impl AsRef<str>) -> SandboxBuilder<I>

Sets the shell for the sandbox

Source

pub fn scripts( self, scripts: impl IntoIterator<Item = (String, String)>, ) -> SandboxBuilder<I>

Sets the scripts for the sandbox

Source

pub fn command( self, command: impl IntoIterator<Item = String>, ) -> SandboxBuilder<I>

Sets the command for the sandbox

Source

pub fn imports( self, imports: impl IntoIterator<Item = (String, Utf8UnixPathBuf)>, ) -> SandboxBuilder<I>

Sets the files to import for the sandbox

Source

pub fn exports( self, exports: impl IntoIterator<Item = (String, Utf8UnixPathBuf)>, ) -> SandboxBuilder<I>

Sets the files to export for the sandbox

Source

pub fn scope(self, scope: NetworkScope) -> SandboxBuilder<I>

Sets the network scope for the sandbox

Source§

impl SandboxBuilder<ReferenceOrPath>

Source

pub fn build(self) -> Sandbox

Builds the sandbox

Trait Implementations§

Source§

impl Default for SandboxBuilder<()>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,