TextBox

Struct TextBox 

Source
pub struct TextBox<'a> {
    pub single_line_mode: bool,
    /* private fields */
}

Fields§

§single_line_mode: bool

Implementations§

Source§

impl<'a> TextBox<'a>

Source

pub fn new(lines: Vec<String>, single_line_mode: bool) -> Self

Source

pub fn from_list_of_strings(lines: Vec<String>, single_line_mode: bool) -> Self

Source

pub fn from_list_of_str(lines: Vec<&'a str>, single_line_mode: bool) -> Self

Source

pub fn from_string_with_newline_sep(s: String, single_line_mode: bool) -> Self

Source

pub fn reset(&mut self)

Source

pub fn get_joined_lines(&self) -> String

Source

pub fn get_num_lines(&self) -> usize

Source

pub fn set_placeholder_text(&mut self, placeholder: impl Into<String>)

Source

pub fn set_mask_char(&mut self, mask: char)

Source

pub fn clear_mask_char(&mut self)

Source

pub fn disable_cursor(&mut self)

Source

pub fn enable_cursor(&mut self, cursor_style: Style)

Source

pub fn input(&mut self, input: Key) -> bool

Source

pub fn input_without_shortcuts(&mut self, input: Key) -> bool

Source

pub fn set_selection_style(&mut self, style: Style)

Source

pub fn copy(&mut self)

Source

pub fn cut(&mut self) -> bool

Source

pub fn paste(&mut self) -> bool

Source

pub fn insert_char(&mut self, c: char)

Source

pub fn insert_str<S: AsRef<str>>(&mut self, s: S) -> bool

Source

pub fn delete_str(&mut self, chars: usize) -> bool

Source

pub fn insert_tab(&mut self) -> bool

Source

pub fn insert_newline(&mut self)

Source

pub fn delete_newline(&mut self) -> bool

Source

pub fn delete_char(&mut self) -> bool

Source

pub fn delete_next_char(&mut self) -> bool

Source

pub fn delete_line_by_end(&mut self) -> bool

Source

pub fn delete_line_by_head(&mut self) -> bool

Source

pub fn delete_word(&mut self) -> bool

Source

pub fn delete_next_word(&mut self) -> bool

Source

pub fn select_all(&mut self)

Source

pub fn move_cursor(&mut self, m: CursorMove)

Source

pub fn undo(&mut self) -> bool

Source

pub fn redo(&mut self) -> bool

Source

pub fn widget(&'a self) -> impl Widget + 'a

Source

pub fn style(&self) -> Style

Source

pub fn set_block(&mut self, block: Block<'a>)

Source

pub fn block<'s>(&'s self) -> Option<&'s Block<'a>>

Source

pub fn set_line_number_style(&mut self, style: Style)

Source

pub fn remove_line_number(&mut self)

Source

pub fn lines(&'a self) -> &'a [String]

Source

pub fn cursor(&self) -> (usize, usize)

Source

pub fn set_alignment(&mut self, alignment: Alignment)

Source

pub fn alignment(&self) -> Alignment

Source

pub fn is_empty(&self) -> bool

Source

pub fn scroll(&mut self, scrolling: impl Into<TextBoxScroll>)

Source

pub fn start_selection(&mut self)

Source

pub fn cancel_selection(&mut self)

Source

pub fn get_non_ascii_aware_cursor_x_pos(&self) -> usize

Trait Implementations§

Source§

impl<'a> Clone for TextBox<'a>

Source§

fn clone(&self) -> TextBox<'a>

Returns a duplicate 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<'a> Debug for TextBox<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for TextBox<'a>

§

impl<'a> RefUnwindSafe for TextBox<'a>

§

impl<'a> Send for TextBox<'a>

§

impl<'a> Sync for TextBox<'a>

§

impl<'a> Unpin for TextBox<'a>

§

impl<'a> UnwindSafe for TextBox<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more