pub struct PromptLine<U> { /* private fields */ }Expand description
A multi purpose text Widget
This Widget will be used by a Prompt-type Mode, which
in turn will make use of a PromptMode. These are “ways of
interpreting the input”. In Duat, there are 3 built-in
PromptModes:
RunCommands: Will interpret the prompt as a Duat command to be executed.IncSearch: Will read the prompt as a regex, and modify the activeFileaccording to a givenIncSearcher.PipeSelections: Will pass each selection to a shell command, replacing the selections with thestdout.
Implementations§
Source§impl<U: Ui> PromptLine<U>
impl<U: Ui> PromptLine<U>
Sourcepub fn prompt_of<M: PromptMode<U>>(&self) -> Option<Text>
pub fn prompt_of<M: PromptMode<U>>(&self) -> Option<Text>
Returns the prompt for a PromptMode if there is any
Sourcepub fn set_prompt<M: PromptMode<U>>(&mut self, text: Text)
pub fn set_prompt<M: PromptMode<U>>(&mut self, text: Text)
Sets the prompt for the given PromptMode
Trait Implementations§
Source§impl<U: Ui> Widget<U> for PromptLine<U>
impl<U: Ui> Widget<U> for PromptLine<U>
Source§fn needs_update(&self, _: &Pass) -> bool
fn needs_update(&self, _: &Pass) -> bool
Source§fn once() -> Result<(), Text>
fn once() -> Result<(), Text>
Actions taken when this widget opens for the first time Read more
Auto Trait Implementations§
impl<U> Freeze for PromptLine<U>
impl<U> !RefUnwindSafe for PromptLine<U>
impl<U> Send for PromptLine<U>where
U: Send,
impl<U> !Sync for PromptLine<U>
impl<U> Unpin for PromptLine<U>where
U: Unpin,
impl<U> !UnwindSafe for PromptLine<U>
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