pub struct RuntimePermissions { /* private fields */ }Expand description
Runtime permissions enforcer
Implementations§
Source§impl RuntimePermissions
impl RuntimePermissions
Sourcepub fn new(permissions: Permissions) -> Self
pub fn new(permissions: Permissions) -> Self
Create new runtime permissions
Sourcepub fn add_callback<F>(&mut self, callback: F)
pub fn add_callback<F>(&mut self, callback: F)
Add a callback for permission checks
Sourcepub fn set_log_level(&mut self, level: LogLevel)
pub fn set_log_level(&mut self, level: LogLevel)
Set log level
Sourcepub fn set_enforce(&mut self, enforce: bool)
pub fn set_enforce(&mut self, enforce: bool)
Set enforcement (false = allow all operations)
Sourcepub fn get_events(&self) -> Vec<PermissionEvent>
pub fn get_events(&self) -> Vec<PermissionEvent>
Get event log
Sourcepub fn clear_events(&self)
pub fn clear_events(&self)
Clear event log
Sourcepub fn on_print_high_quality(&self, context: Option<String>) -> Result<()>
pub fn on_print_high_quality(&self, context: Option<String>) -> Result<()>
Validate high-quality print operation
Sourcepub fn on_modify_annotations(&self, context: Option<String>) -> Result<()>
pub fn on_modify_annotations(&self, context: Option<String>) -> Result<()>
Validate annotation modification
Trait Implementations§
Source§impl PermissionsValidator for RuntimePermissions
impl PermissionsValidator for RuntimePermissions
Source§fn validate(&self, operation: PermissionOperation) -> Result<bool>
fn validate(&self, operation: PermissionOperation) -> Result<bool>
Validate a permission operation
Source§fn permissions(&self) -> Permissions
fn permissions(&self) -> Permissions
Get current permissions
Auto Trait Implementations§
impl !Freeze for RuntimePermissions
impl !RefUnwindSafe for RuntimePermissions
impl Send for RuntimePermissions
impl Sync for RuntimePermissions
impl Unpin for RuntimePermissions
impl !UnwindSafe for RuntimePermissions
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more