pub struct ApprovalController { /* private fields */ }Expand description
Manages the inline approval prompt state machine.
Implementations§
Source§impl ApprovalController
impl ApprovalController
Sourcepub fn working_dir(&self) -> &str
pub fn working_dir(&self) -> &str
The working directory for the command.
Sourcepub fn options(&self) -> &[ApprovalOption]
pub fn options(&self) -> &[ApprovalOption]
The available options.
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
The currently selected option index.
Sourcepub fn start(
&mut self,
command: String,
working_dir: String,
) -> Receiver<ApprovalDecision>
pub fn start( &mut self, command: String, working_dir: String, ) -> Receiver<ApprovalDecision>
Start the approval prompt for a command.
Returns a receiver that will yield the user’s decision.
Sourcepub fn move_selection(&mut self, delta: i32)
pub fn move_selection(&mut self, delta: i32)
Move the selection by delta positions (wrapping).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApprovalController
impl !RefUnwindSafe for ApprovalController
impl Send for ApprovalController
impl Sync for ApprovalController
impl Unpin for ApprovalController
impl UnsafeUnpin for ApprovalController
impl !UnwindSafe for ApprovalController
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
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>
Converts
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>
Converts
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