pub struct Sandbox {
pub child_pid: i32,
/* private fields */
}
Fields§
§child_pid: i32
Implementations§
Source§impl Sandbox
impl Sandbox
pub fn new( executor: Executor, rlimit_configs: RlimitConfigs, input_redirect: Option<RawFd>, output_redirect: Option<RawFd>, restricted: bool, ) -> Result<Self, JudgeCoreError>
pub fn wait(&self) -> Result<RawRunResultInfo, JudgeCoreError>
Sourcepub fn spawn(&mut self) -> Result<i32, JudgeCoreError>
pub fn spawn(&mut self) -> Result<i32, JudgeCoreError>
WARNING:
Unsafe to use println!()
(or unwrap()
) in child process.
See more in fork()
document.
Auto Trait Implementations§
impl Freeze for Sandbox
impl RefUnwindSafe for Sandbox
impl !Send for Sandbox
impl !Sync for Sandbox
impl Unpin for Sandbox
impl UnwindSafe for Sandbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more