[][src]Struct rustwide::cmd::SandboxBuilder

pub struct SandboxBuilder { /* fields omitted */ }

The sandbox builder allows to configure a sandbox, used later in a Command.

Implementations

impl SandboxBuilder[src]

pub fn new() -> Self[src]

Create a new sandbox builder.

pub fn mount(
    self,
    host_path: &Path,
    sandbox_path: &Path,
    kind: MountKind
) -> Self
[src]

Mount a path inside the sandbox. It's possible to choose whether to mount the path read-only or writeable through the MountKind enum.

pub fn memory_limit(self, limit: Option<usize>) -> Self[src]

Enable or disable the sandbox's memory limit. When the processes inside the sandbox use more memory than the limit the sandbox will be killed.

By default no memory limit is present, and its size is provided in bytes.

pub fn cpu_limit(self, limit: Option<f32>) -> Self[src]

Enable or disable the sandbox's CPU limit. The value of the limit is the fraction of CPU cores the sandbox is allowed to use.

For example, on a 4-core machine, setting a CPU limit of 2.0 will only allow two of the cores to be used, while a CPU limit of 0.5 will only allow half of a single CPU core to be used.

pub fn enable_networking(self, enable: bool) -> Self[src]

Enable or disable the sandbox's networking. When it's disabled processes inside the sandbox won't be able to reach network service on the Internet or the host machine.

By default networking is enabled.

Trait Implementations

impl Clone for SandboxBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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