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 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 mount /proc
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for SandboxConfiguration
impl Send for SandboxConfiguration
impl Sync for SandboxConfiguration
impl Unpin for SandboxConfiguration
impl UnwindSafe for SandboxConfiguration
Blanket Implementations
Mutably borrows from an owned value. Read more