pub enum PolicyDecision {
Allow,
AllowWithGrant(Grant),
Deny {
reason: Option<String>,
},
AskUser,
}Expand description
Decision from a permission policy.
Variants§
Allow
Allow the request immediately.
AllowWithGrant(Grant)
Allow and grant permission for similar future requests.
The grant is stored and used to auto-approve matching requests.
Deny
Deny the request immediately.
AskUser
Defer to the consumer (show prompt to user).
This is the default for interactive frontends.
Implementations§
Source§impl PolicyDecision
impl PolicyDecision
Sourcepub fn allow_with_grant(grant: Grant) -> Self
pub fn allow_with_grant(grant: Grant) -> Self
Create an AllowWithGrant decision.
Sourcepub fn deny_silent() -> Self
pub fn deny_silent() -> Self
Create a Deny decision without a reason.
Trait Implementations§
Source§impl Clone for PolicyDecision
impl Clone for PolicyDecision
Source§fn clone(&self) -> PolicyDecision
fn clone(&self) -> PolicyDecision
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 moreAuto Trait Implementations§
impl Freeze for PolicyDecision
impl RefUnwindSafe for PolicyDecision
impl Send for PolicyDecision
impl Sync for PolicyDecision
impl Unpin for PolicyDecision
impl UnwindSafe for PolicyDecision
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