pub enum ApprovalResponse {
AllowOnce,
AllowSession,
AllowAlways,
Deny,
}Expand description
Response to an approval request from the user.
Variants§
AllowOnce
Allow this specific command only
AllowSession
Allow this command prefix for the current session (resets on restart)
AllowAlways
Allow this command prefix forever (persists to database)
Deny
Deny the command
Implementations§
Source§impl ApprovalResponse
impl ApprovalResponse
Sourcepub fn grant_lifetime(&self) -> Option<GrantLifetime>
pub fn grant_lifetime(&self) -> Option<GrantLifetime>
How long this answer asks an approval to last (None: Deny).
Sourcepub fn capped_to(self, offer: &GrantOffer) -> ApprovalResponse
pub fn capped_to(self, offer: &GrantOffer) -> ApprovalResponse
This answer as it stands under offer: one that asks for longer
than the offer’s max is capped to it (Always on a session offer is
Allow for session; any Allow on a once offer is Allow once). Deny
stays Deny.
Trait Implementations§
Source§impl Clone for ApprovalResponse
impl Clone for ApprovalResponse
Auto Trait Implementations§
impl Forget for ApprovalResponse
impl Freeze for ApprovalResponse
impl Move for ApprovalResponse
impl RefUnwindSafe for ApprovalResponse
impl Send for ApprovalResponse
impl Sync for ApprovalResponse
impl Unpin for ApprovalResponse
impl UnsafeUnpin for ApprovalResponse
impl UnwindSafe for ApprovalResponse
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