Struct rustwide::cmd::SandboxBuilder [−][src]
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]
self,
host_path: &Path,
sandbox_path: &Path,
kind: MountKind
) -> Self
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]
fn clone(&self) -> SandboxBuilder
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for SandboxBuilder
impl Send for SandboxBuilder
impl Sync for SandboxBuilder
impl Unpin for SandboxBuilder
impl UnwindSafe for SandboxBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,