pub struct Permissions {
pub network: NetworkPermission,
pub filesystem: FileSystemPermission,
pub max_memory_bytes: Option<usize>,
pub max_cpu_time: Option<Duration>,
pub allowed_syscalls: Option<HashSet<String>>,
}Expand description
Permission system for tools
Fields§
§network: NetworkPermission§filesystem: FileSystemPermission§max_memory_bytes: Option<usize>§max_cpu_time: Option<Duration>§allowed_syscalls: Option<HashSet<String>>Implementations§
Source§impl Permissions
impl Permissions
pub fn unrestricted() -> Self
pub fn builder() -> PermissionsBuilder
pub fn check_network_access(&self, host: &str) -> ToolResult<()>
pub fn check_file_access(&self, path: &Path) -> ToolResult<()>
Trait Implementations§
Source§impl Clone for Permissions
impl Clone for Permissions
Source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
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 Permissions
impl Debug for Permissions
Auto Trait Implementations§
impl Freeze for Permissions
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
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