[−][src]Struct tabox::configuration::SandboxConfiguration
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 fot 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<u8>
Set on which CPU core to run the sandbox
Methods
impl SandboxConfiguration
[src]
pub fn build(&self) -> SandboxConfiguration
[src]
Build the sandbox configuration
pub fn time_limit(&mut self, time_limit: u64) -> &mut Self
[src]
Set the time limit
pub fn memory_limit(&mut self, memory_limit: u64) -> &mut Self
[src]
Set the memory limit
pub fn stdin(&mut self, stdin: PathBuf) -> &mut Self
[src]
Set the standard input file path
pub fn stdout(&mut self, stdout: PathBuf) -> &mut Self
[src]
Set the standard output file path
pub fn stderr(&mut self, stderr: PathBuf) -> &mut Self
[src]
Set the standard error file path
pub fn executable<P: Into<PathBuf>>(&mut self, executable: P) -> &mut Self
[src]
Set the executable file path
pub fn working_directory<P: Into<PathBuf>>(
&mut self,
working_directory: P
) -> &mut Self
[src]
&mut self,
working_directory: P
) -> &mut Self
Set the working directory
pub fn arg<S: Into<String>>(&mut self, arg: S) -> &mut Self
[src]
Add an argument to the program
pub fn env<S: Into<String>, T: Into<String>>(
&mut self,
variable: S,
value: T
) -> &mut Self
[src]
&mut self,
variable: S,
value: T
) -> &mut Self
Add an argument to the environment
pub fn mount<P, Q>(&mut self, source: P, target: Q, writable: bool) -> &mut Self where
P: Into<PathBuf>,
Q: Into<PathBuf>,
[src]
P: Into<PathBuf>,
Q: Into<PathBuf>,
Add a mount point into the sandbox
pub fn syscall_filter(&mut self, filter: SyscallFilter) -> &mut Self
[src]
Install the syscall filter
pub fn mount_tmpfs(&mut self, value: bool) -> &mut Self
[src]
Mount a r/w tmpfs in /tmp and /dev/shm
pub fn wall_time_limit(&mut self, value: u64) -> &mut Self
[src]
Set wall time limit
pub fn run_on_core(&mut self, value: u8) -> &mut Self
[src]
Run the sandbox on the specified cpu core
Trait Implementations
impl Clone for SandboxConfiguration
[src]
fn clone(&self) -> SandboxConfiguration
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for SandboxConfiguration
[src]
impl Debug for SandboxConfiguration
[src]
impl Serialize for SandboxConfiguration
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for SandboxConfiguration
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for SandboxConfiguration
impl Sync for SandboxConfiguration
impl Unpin for SandboxConfiguration
impl UnwindSafe for SandboxConfiguration
impl RefUnwindSafe for SandboxConfiguration
Blanket Implementations
impl<T> From<T> for T
[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.
fn to_owned(&self) -> T
[src]
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 = !
The type returned in the event of a conversion error.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,