pub enum ProviderWizard {
MainMenu {
selected: usize,
},
Add {
step: WizardStep,
draft: DraftProvider,
},
EditPick {
providers: Vec<String>,
selected: usize,
},
Edit {
target: String,
step: WizardStep,
draft: DraftProvider,
},
DeletePick {
providers: Vec<String>,
selected: usize,
},
DeleteConfirm {
target: String,
},
SetDefaultPick {
providers: Vec<String>,
selected: usize,
},
}Variants§
MainMenu
Initial picker: Add / Edit / Delete / Set Default.
Add
Sequential Add prompts. draft accumulates answered fields.
EditPick
Pick which provider to edit.
Edit
Editing a specific provider; same flow as Add but prompts show
the existing value as a hint and an empty Enter keeps it.
DeletePick
Pick which provider to delete.
DeleteConfirm
Final y/N confirmation before a delete actually lands.
SetDefaultPick
Pick which provider to make default.
Trait Implementations§
Source§impl Modal for ProviderWizard
impl Modal for ProviderWizard
Source§fn handle_key(
&mut self,
code: KeyCode,
mods: KeyModifiers,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_key( &mut self, code: KeyCode, mods: KeyModifiers, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Process one keystroke. Must either fully handle it (including
any re-paint the modal wants) or report that the modal is now
done so the caller can tear it down.
Source§fn draw(
&self,
buf: &Buffer,
state: &UiState,
ctx: &LoopCtx,
renderer: &mut dyn Renderer,
)
fn draw( &self, buf: &Buffer, state: &UiState, ctx: &LoopCtx, renderer: &mut dyn Renderer, )
Paint the modal against the current terminal state. Called once
when the modal is installed into
active_modal; handle_key
is expected to handle subsequent repaints after each key.Source§fn handle_paste(
&mut self,
text: &str,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_paste( &mut self, text: &str, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Handle a bracketed-paste payload while the modal is active.
Default: append the text to
buf (so text-input wizard steps
naturally accept URL / API-key paste) and redraw. Modals that
only present pickers (no text input) can leave the default —
buf updates are harmless when the modal isn’t displaying it.Auto Trait Implementations§
impl Freeze for ProviderWizard
impl RefUnwindSafe for ProviderWizard
impl Send for ProviderWizard
impl Sync for ProviderWizard
impl Unpin for ProviderWizard
impl UnsafeUnpin for ProviderWizard
impl UnwindSafe for ProviderWizard
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