pub enum PermissionAnswer {
AllowOnce,
AllowForSession {
pattern: Option<String>,
},
Deny,
}Expand description
The user’s answer to a PendingPermission (#3422).
Why: the TUI must offer all three answers the backend understands, and
must compute none of them — per the thin-client axiom (ADR-0063) this
enum only NAMES which button was pressed; the engine adapter translates
it into its own backend’s decision type and the backend applies the
policy. Nothing here knows what a grant covers or how long it lasts.
What: AllowForSession.pattern is the optional grant width. This crate
never invents one — the key binding sends None, which asks the backend
for whatever its own default width is for the subject it asked about.
Test: crate::app::reduce::tests::permission_key_y_answers_allow_once
and its siblings.
Variants§
AllowOnce
Permit this one call.
AllowForSession
Permit this call and stop asking for the rest of the session.
Deny
Refuse this call.
Trait Implementations§
Source§impl Clone for PermissionAnswer
impl Clone for PermissionAnswer
Source§impl Debug for PermissionAnswer
impl Debug for PermissionAnswer
impl Eq for PermissionAnswer
Source§impl PartialEq for PermissionAnswer
impl PartialEq for PermissionAnswer
impl StructuralPartialEq for PermissionAnswer
Auto Trait Implementations§
impl Forget for PermissionAnswer
impl Freeze for PermissionAnswer
impl Move for PermissionAnswer
impl RefUnwindSafe for PermissionAnswer
impl Send for PermissionAnswer
impl Sync for PermissionAnswer
impl Unpin for PermissionAnswer
impl UnsafeUnpin for PermissionAnswer
impl UnwindSafe for PermissionAnswer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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