Struct tabox::configuration::SandboxConfiguration[][src]

pub struct SandboxConfiguration {
Show 18 fields pub time_limit: Option<u64>, pub memory_limit: Option<u64>, pub stack_limit: Option<u64>, pub executable: PathBuf, pub args: Vec<String>, pub env: Vec<(String, String)>, pub mount_paths: Vec<DirectoryMount>, pub working_directory: PathBuf, pub stdin: Option<PathBuf>, pub stdout: Option<PathBuf>, pub stderr: Option<PathBuf>, pub syscall_filter: Option<SyscallFilter>, pub mount_tmpfs: bool, pub wall_time_limit: Option<u64>, pub cpu_core: Option<usize>, pub uid: usize, pub gid: usize, pub mount_proc: bool,
}
Expand description

struct that represents the configuration parameters of a sandbox

Fields

time_limit: Option<u64>

Time limit for the execution in seconds

memory_limit: Option<u64>

Memory limit for the execution in bytes

stack_limit: Option<u64>

Stack limit for the execution in bytes

executable: PathBuf

Absolute path of the executable

args: Vec<String>

Arguments to pass to the executable

env: Vec<(String, String)>

Environment to pass to the sandbox

mount_paths: Vec<DirectoryMount>

Allowed paths inside the sandbox

working_directory: PathBuf

Working directory

stdin: Option<PathBuf>

Redirect stdin from this file

stdout: Option<PathBuf>

Redirect stdout from this file

stderr: Option<PathBuf>

Redirect stderr from this file

syscall_filter: Option<SyscallFilter>

Allow only these system calls in the sandbox

mount_tmpfs: bool

Mount a r/w tmpfs in /tmp and /dev/shm

wall_time_limit: Option<u64>

Wall time limit

cpu_core: Option<usize>

Set on which CPU core to run the sandbox

uid: usize

UID of the user inside the sandbox

gid: usize

GID of the user inside the sandbox

mount_proc: bool

Mount /proc

Implementations

Build the sandbox configuration

Set the time limit in seconds

Set the memory limit, in bytes

Set the stack limit, in bytes

Set the standard input file path

Set the standard output file path

Set the standard error file path

Set the executable file path

Set the working directory

Add an argument to the program

Add an argument to the environment

Add a mount point into the sandbox

Install the syscall filter

Mount a r/w tmpfs in /tmp and /dev/shm

Set wall time limit

Run the sandbox on the specified cpu core

Set the UID of the user inside the sandbox

Set the GID of the user inside the sandbox

Set mount /proc

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.