pub struct PromptLine { /* 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 activeBufferaccording to a givenIncSearcher.PipeSelections: Will pass each selection to a shell command, replacing the selections with thestdout.
Implementations§
Source§impl PromptLine
impl PromptLine
Sourcepub fn builder() -> PromptLineBuilder
pub fn builder() -> PromptLineBuilder
Returns a [PromptLineBuilder], which can be used to push
PromptLines around
Sourcepub fn prompt_of<M: PromptMode>(&self) -> Option<Text>
pub fn prompt_of<M: PromptMode>(&self) -> Option<Text>
Returns the prompt for a PromptMode if there is any
Sourcepub fn set_prompt<M: PromptMode>(&mut self, text: Text)
pub fn set_prompt<M: PromptMode>(&mut self, text: Text)
Sets the prompt for the given PromptMode
Trait Implementations§
Source§impl Widget for PromptLine
impl Widget for PromptLine
Auto Trait Implementations§
impl Freeze for PromptLine
impl !RefUnwindSafe for PromptLine
impl Send for PromptLine
impl !Sync for PromptLine
impl Unpin for PromptLine
impl !UnwindSafe for PromptLine
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.