pub struct TuiApprovalHandler { /* private fields */ }Expand description
P5-1’s interactive ask-UI, closing the deferred chain
crate::permissions::approval’s module doc comment names. ask pushes
the request onto tx and blocks on a fresh one-shot reply channel;
Self::tx being closed (the render loop is gone) makes the blocking
recv() return an Err, which resolves to
ApprovalOutcome::Deny — fail-closed, matching the trait’s own “no
handler ⇒ deny” default posture for the “handler installed but
unreachable” case too.
Implementations§
Source§impl TuiApprovalHandler
impl TuiApprovalHandler
Sourcepub fn new(tx: Sender<PendingApprovalRequest>) -> Self
pub fn new(tx: Sender<PendingApprovalRequest>) -> Self
Construct a handler that feeds tx — the matching Receiver half
is TuiBridge::approval_rx.
Trait Implementations§
Source§impl PermissionsApprovalHandler for TuiApprovalHandler
impl PermissionsApprovalHandler for TuiApprovalHandler
Source§fn ask(&self, req: &ApprovalRequest<'_>) -> ApprovalOutcome
fn ask(&self, req: &ApprovalRequest<'_>) -> ApprovalOutcome
Render a decision for
req. Implementations that need to block on
user input (a real TUI prompt) do so here; a scripted/headless
implementation (tests, CI, an --auto-approve flag) returns
immediately.Auto Trait Implementations§
impl Freeze for TuiApprovalHandler
impl RefUnwindSafe for TuiApprovalHandler
impl Send for TuiApprovalHandler
impl Sync for TuiApprovalHandler
impl Unpin for TuiApprovalHandler
impl UnsafeUnpin for TuiApprovalHandler
impl UnwindSafe for TuiApprovalHandler
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