pub struct SandboxedPythonExecutor { /* private fields */ }Expand description
Sandboxed Python executor with security restrictions
Implementations§
Source§impl SandboxedPythonExecutor
impl SandboxedPythonExecutor
Sourcepub fn with_interpreter(self, interpreter: impl Into<String>) -> Self
pub fn with_interpreter(self, interpreter: impl Into<String>) -> Self
Create executor with custom interpreter path
Sourcepub fn with_max_output(self, bytes: usize) -> Self
pub fn with_max_output(self, bytes: usize) -> Self
Set maximum output size
Sourcepub fn with_blocked_modules(self, modules: &[&str]) -> Self
pub fn with_blocked_modules(self, modules: &[&str]) -> Self
Add additional blocked modules
Sourcepub fn with_file_io(self, allow: bool) -> Self
pub fn with_file_io(self, allow: bool) -> Self
Allow file I/O operations (not recommended for untrusted code)
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if Python interpreter is available
Trait Implementations§
Source§impl Clone for SandboxedPythonExecutor
impl Clone for SandboxedPythonExecutor
Source§fn clone(&self) -> SandboxedPythonExecutor
fn clone(&self) -> SandboxedPythonExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SandboxedPythonExecutor
impl Debug for SandboxedPythonExecutor
Source§impl Default for SandboxedPythonExecutor
impl Default for SandboxedPythonExecutor
Auto Trait Implementations§
impl Freeze for SandboxedPythonExecutor
impl RefUnwindSafe for SandboxedPythonExecutor
impl Send for SandboxedPythonExecutor
impl Sync for SandboxedPythonExecutor
impl Unpin for SandboxedPythonExecutor
impl UnsafeUnpin for SandboxedPythonExecutor
impl UnwindSafe for SandboxedPythonExecutor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more