pub struct SandboxManager { /* private fields */ }Expand description
The sandbox manager - main entry point for sandbox operations.
Implementations§
Source§impl SandboxManager
impl SandboxManager
Sourcepub fn is_supported_platform() -> bool
pub fn is_supported_platform() -> bool
Check if the current platform is supported.
Sourcepub fn check_dependencies(
&self,
config: Option<&SandboxRuntimeConfig>,
) -> Result<(), SandboxError>
pub fn check_dependencies( &self, config: Option<&SandboxRuntimeConfig>, ) -> Result<(), SandboxError>
Check if all required dependencies are available.
Sourcepub async fn initialize(
&self,
config: SandboxRuntimeConfig,
) -> Result<(), SandboxError>
pub async fn initialize( &self, config: SandboxRuntimeConfig, ) -> Result<(), SandboxError>
Initialize the sandbox manager with the given configuration.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the manager is initialized.
Sourcepub fn get_config(&self) -> Option<SandboxRuntimeConfig>
pub fn get_config(&self) -> Option<SandboxRuntimeConfig>
Get the current configuration.
Sourcepub fn update_config(
&self,
config: SandboxRuntimeConfig,
) -> Result<(), SandboxError>
pub fn update_config( &self, config: SandboxRuntimeConfig, ) -> Result<(), SandboxError>
Update the configuration.
Sourcepub fn get_proxy_port(&self) -> Option<u16>
pub fn get_proxy_port(&self) -> Option<u16>
Get the HTTP proxy port.
Sourcepub fn get_socks_proxy_port(&self) -> Option<u16>
pub fn get_socks_proxy_port(&self) -> Option<u16>
Get the SOCKS proxy port.
Sourcepub fn get_http_socket_path(&self) -> Option<String>
pub fn get_http_socket_path(&self) -> Option<String>
Get the HTTP socket path (Linux only).
Sourcepub fn get_socks_socket_path(&self) -> Option<String>
pub fn get_socks_socket_path(&self) -> Option<String>
Get the SOCKS socket path (Linux only).
Sourcepub fn is_network_ready(&self) -> bool
pub fn is_network_ready(&self) -> bool
Check if network is ready.
Sourcepub async fn wait_for_network_initialization(&self) -> bool
pub async fn wait_for_network_initialization(&self) -> bool
Wait for network initialization.
Sourcepub fn get_fs_read_config(&self) -> FsReadRestrictionConfig
pub fn get_fs_read_config(&self) -> FsReadRestrictionConfig
Get filesystem read restriction config.
Sourcepub fn get_fs_write_config(&self) -> FsWriteRestrictionConfig
pub fn get_fs_write_config(&self) -> FsWriteRestrictionConfig
Get filesystem write restriction config.
Sourcepub fn get_linux_glob_pattern_warnings(&self) -> Vec<String>
pub fn get_linux_glob_pattern_warnings(&self) -> Vec<String>
Get glob pattern warnings for Linux.
Sourcepub fn get_violation_store(&self) -> Arc<SandboxViolationStore>
pub fn get_violation_store(&self) -> Arc<SandboxViolationStore>
Get the violation store.
Sourcepub async fn wrap_with_sandbox(
&self,
command: &str,
shell: Option<&str>,
custom_config: Option<SandboxRuntimeConfig>,
) -> Result<String, SandboxError>
pub async fn wrap_with_sandbox( &self, command: &str, shell: Option<&str>, custom_config: Option<SandboxRuntimeConfig>, ) -> Result<String, SandboxError>
Wrap a command with sandbox restrictions.
Sourcepub fn annotate_stderr_with_sandbox_failures(
&self,
command: &str,
stderr: &str,
) -> String
pub fn annotate_stderr_with_sandbox_failures( &self, command: &str, stderr: &str, ) -> String
Annotate stderr with sandbox failure information.
Trait Implementations§
Source§impl Default for SandboxManager
impl Default for SandboxManager
Auto Trait Implementations§
impl Freeze for SandboxManager
impl !RefUnwindSafe for SandboxManager
impl Send for SandboxManager
impl Sync for SandboxManager
impl Unpin for SandboxManager
impl !UnwindSafe for SandboxManager
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