pub struct InputUI {
pub input: String,
pub config: InputConfig,
pub prompt: Span<'static>,
pub width: u16,
/* private fields */
}Fields§
§input: String§config: InputConfig§prompt: Span<'static>§width: u16Implementations§
Source§impl InputUI
impl InputUI
pub fn new(config: InputConfig) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn cursor_offset(&self, rect: &Rect) -> Position
pub fn cursor_offset(&self, rect: &Rect) -> Position
Given a rect the widget is rendered with, produce the absolute position the cursor is rendered at.
pub fn push_char(&mut self, c: char)
pub fn push_str(&mut self, content: &str)
pub fn set(&mut self, input: impl Into<Option<String>>, cursor: u16)
pub fn update_width(&mut self, width: u16)
pub fn scroll_to_cursor(&mut self)
pub fn set_at_visual_offset(&mut self, visual_offset: u16)
pub fn cancel(&mut self)
pub fn reset_prompt(&mut self)
pub fn forward_char(&mut self)
pub fn backward_char(&mut self)
pub fn forward_word(&mut self)
pub fn backward_word(&mut self)
pub fn delete(&mut self)
pub fn delete_word(&mut self)
pub fn delete_line_start(&mut self)
pub fn delete_line_end(&mut self)
pub fn make_input(&self) -> Paragraph<'_>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputUI
impl RefUnwindSafe for InputUI
impl Send for InputUI
impl Sync for InputUI
impl Unpin for InputUI
impl UnsafeUnpin for InputUI
impl UnwindSafe for InputUI
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformExt for T
impl<T> TransformExt for T
fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q
fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T
Source§fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
Example Read more