[][src]Struct unsegen::widget::builtin::promptline::PromptLine

pub struct PromptLine {
    pub line: LineEdit,
    // some fields omitted
}

A widget implementing "readline"-like functionality.

Basically a more sophisticated version of LineEdit with history.

Fields

line: LineEdit

Methods

impl PromptLine[src]

pub fn with_prompt(prompt: String) -> Self[src]

Construct a PromptLine with the given symbol that will be displayed left of the LineEdit for user interaction.

pub fn set_prompt(&mut self, prompt: String)[src]

Change the symbol left of the user editable section.

pub fn previous_line(&self, n: usize) -> Option<&str>[src]

Get the n'th line from the history.

pub fn active_line(&self) -> &str[src]

Get the current content of the LineEdit

pub fn finish_line(&mut self) -> &str[src]

Mark the current content as "accepted", e.g., if the user has entered and submitted a command.

This adds the current line to the front of the history buffer.

Trait Implementations

impl Scrollable for PromptLine[src]

impl Writable for PromptLine[src]

impl Navigatable for PromptLine[src]

impl Editable for PromptLine[src]

impl Widget for PromptLine[src]

Auto Trait Implementations

impl Send for PromptLine

impl Sync for PromptLine

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.