pub struct PermissionResponse {
pub pending: PendingPermission,
pub answer: PermissionAnswer,
}Expand description
An answer staged for the outer driver to relay to
crate::engine::TuiEngine::respond_permission (#3422).
Why: the reducer holds only &mut ReplApp and cannot call an async
engine method, so it stages the answer here — the same pattern
crate::app::ReplApp::pending_submit and pending_cancel use.
What: drained by crate::run::TuiModel::take_pending_permission_response
after every apply call. It carries the whole PendingPermission,
not just its request_id (#3422): the prompt is cleared optimistically
when the key is pressed, so the request would be unrecoverable if the
respond_permission RPC failed — the dispatch layer hands this value
back through crate::event::ReplEvent::PermissionAnswerFailed to
reopen the prompt.
Test: crate::run::tests::dispatch_pending_permission_answer_reaches_respond_permission,
crate::run::tests::dispatch_pending_permission_answer_failure_reopens_the_prompt.
Fields§
§pending: PendingPermissionThe request this answers, kept whole so a failed relay can reopen it.
answer: PermissionAnswerWhat the user chose.
Implementations§
Source§impl PermissionResponse
impl PermissionResponse
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
The correlation key crate::engine::TuiEngine::respond_permission
sends this answer back on.
Trait Implementations§
Source§impl Clone for PermissionResponse
impl Clone for PermissionResponse
Source§impl Debug for PermissionResponse
impl Debug for PermissionResponse
impl Eq for PermissionResponse
Source§impl PartialEq for PermissionResponse
impl PartialEq for PermissionResponse
impl StructuralPartialEq for PermissionResponse
Auto Trait Implementations§
impl Freeze for PermissionResponse
impl RefUnwindSafe for PermissionResponse
impl Send for PermissionResponse
impl Sync for PermissionResponse
impl Unpin for PermissionResponse
impl UnsafeUnpin for PermissionResponse
impl UnwindSafe for PermissionResponse
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