pub struct Permissions {
pub can_allocate: bool,
pub can_network: bool,
pub can_filesystem: bool,
pub can_thread: bool,
pub can_env: bool,
}Expand description
Permission flags for module operations.
Fields§
§can_allocate: boolCan allocate memory.
can_network: boolCan make network calls.
can_filesystem: boolCan access filesystem.
can_thread: boolCan spawn threads.
can_env: boolCan access environment variables.
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub fn restrictive() -> Self
pub fn restrictive() -> Self
Creates restrictive permissions (minimal access).
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Creates permissive permissions (full access).
Sourcepub fn check(&self, permission: Permission) -> bool
pub fn check(&self, permission: Permission) -> bool
Checks if a permission is granted.
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
Source§impl Default for Permissions
impl Default for Permissions
impl Copy 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 UnsafeUnpin 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