pub struct PermissionHandler { /* private fields */ }Expand description
Permission handler with callback support
Implementations§
Source§impl PermissionHandler
impl PermissionHandler
Sourcepub fn new(context: PermissionContext) -> Self
pub fn new(context: PermissionContext) -> Self
Create a new permission handler
Sourcepub fn with_callback(
context: PermissionContext,
callback: PermissionCallback,
) -> Self
pub fn with_callback( context: PermissionContext, callback: PermissionCallback, ) -> Self
Create with a callback
Sourcepub fn check(&self, metadata: PermissionMetadata) -> PermissionResult
pub fn check(&self, metadata: PermissionMetadata) -> PermissionResult
Check permission for a tool
Sourcepub fn is_allowed(&self, metadata: &PermissionMetadata) -> bool
pub fn is_allowed(&self, metadata: &PermissionMetadata) -> bool
Check if tool is allowed
Auto Trait Implementations§
impl !Freeze for PermissionHandler
impl !RefUnwindSafe for PermissionHandler
impl Send for PermissionHandler
impl Sync for PermissionHandler
impl Unpin for PermissionHandler
impl UnsafeUnpin for PermissionHandler
impl !UnwindSafe for PermissionHandler
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