pub struct SandboxConfig {
pub allowed_paths: HashSet<PathBuf>,
pub denied_paths: HashSet<PathBuf>,
pub allowed_hosts: HashSet<String>,
pub denied_hosts: HashSet<String>,
pub allow_shell: bool,
pub allow_network: bool,
pub max_file_size: usize,
pub max_output_size: usize,
}Fields§
§allowed_paths: HashSet<PathBuf>§denied_paths: HashSet<PathBuf>§allowed_hosts: HashSet<String>§denied_hosts: HashSet<String>§allow_shell: bool§allow_network: bool§max_file_size: usize§max_output_size: usizeImplementations§
Source§impl SandboxConfig
impl SandboxConfig
pub fn new() -> Self
pub fn allow_all() -> Self
pub fn allow_path(self, path: impl Into<PathBuf>) -> Self
pub fn deny_path(self, path: impl Into<PathBuf>) -> Self
pub fn allow_host(self, host: impl Into<String>) -> Self
pub fn deny_host(self, host: impl Into<String>) -> Self
pub fn with_shell(self, allow: bool) -> Self
pub fn with_network(self, allow: bool) -> Self
pub fn is_path_allowed(&self, path: &PathBuf) -> bool
pub fn is_host_allowed(&self, host: &str) -> bool
Trait Implementations§
Source§impl Clone for SandboxConfig
impl Clone for SandboxConfig
Source§fn clone(&self) -> SandboxConfig
fn clone(&self) -> SandboxConfig
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 SandboxConfig
impl Debug for SandboxConfig
Auto Trait Implementations§
impl Freeze for SandboxConfig
impl RefUnwindSafe for SandboxConfig
impl Send for SandboxConfig
impl Sync for SandboxConfig
impl Unpin for SandboxConfig
impl UnwindSafe for SandboxConfig
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