pub struct Renderer {
    pub texteditor: TextEditor,
    pub history: Option<History>,
    pub prefix: String,
    pub mask: Option<char>,
    pub prefix_style: ContentStyle,
    pub active_char_style: ContentStyle,
    pub inactive_char_style: ContentStyle,
    pub edit_mode: Mode,
    pub word_break_chars: HashSet<char>,
    pub lines: Option<usize>,
}
Expand description

Represents a renderer for the TextEditor component, capable of visualizing text input in a pane. It supports a variety of features including history navigation, input suggestions, input masking, customizable prompt strings, and styles for different parts of the input. It also handles different edit modes such as insert and overwrite, and can be configured to render a specific number of lines.

Fields§

§texteditor: TextEditor

The TextEditor component to be rendered.

§history: Option<History>

Optional history for navigating through previous inputs.

§prefix: String

Prompt string displayed before the input text.

§mask: Option<char>

Optional character used for masking the input string (e.g., for password fields).

§prefix_style: ContentStyle

Style applied to the prompt string.

§active_char_style: ContentStyle

Style applied to the currently selected character.

§inactive_char_style: ContentStyle

Style applied to characters that are not currently selected.

§edit_mode: Mode

Current edit mode, determining whether input inserts or overwrites existing text.

§word_break_chars: HashSet<char>

Characters to be for word break.

§lines: Option<usize>

Number of lines available for rendering.

Trait Implementations§

source§

impl AsAny for Renderer

source§

fn as_any(&self) -> &dyn Any

Returns Any.
source§

fn as_any_mut(&mut self) -> &mut dyn Any

source§

impl Clone for Renderer

source§

fn clone(&self) -> Renderer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Renderer for Renderer

source§

fn create_panes(&self, width: u16) -> Vec<Pane>

Creates panes with the given width.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.