pub struct SandboxConfig {
pub io_permissions: IOPermissions,
pub filesystem_policy: SandboxPolicy,
pub filesystem_restriction: Option<PathRestriction>,
pub module_policy: SandboxPolicy,
pub module_restriction: Option<PathRestriction>,
pub enable_metrics: bool,
pub max_module_cache_size: usize,
pub module_cache_ttl_secs: u64,
pub execution_limits: ExecutionLimits,
}Expand description
统一的沙箱配置
Fields§
§io_permissions: IOPermissionsIO 权限(保留向后兼容)
filesystem_policy: SandboxPolicy文件系统沙箱策略
filesystem_restriction: Option<PathRestriction>文件系统路径限制
module_policy: SandboxPolicy模块系统沙箱策略
module_restriction: Option<PathRestriction>模块路径限制
enable_metrics: bool是否启用可观测性指标收集
max_module_cache_size: usize最大模块缓存数量(0 = 不限制)
module_cache_ttl_secs: u64模块缓存 TTL(秒,0 = 永不过期)
execution_limits: ExecutionLimits执行限制配置
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
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