pub struct QueryUI {
pub state: InputUI,
pub config: QueryConfig,
/* private fields */
}Fields§
§state: InputUI§config: QueryConfigImplementations§
Source§impl QueryUI
impl QueryUI
pub fn new(config: QueryConfig) -> Self
pub fn left(&self) -> u16
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 update_width(&mut self, width: u16)
pub fn scroll_to_cursor(&mut self)
pub fn make_input(&self) -> Paragraph<'_>
Sourcepub fn set_prompt(&mut self, template: Option<Line<'static>>)
pub fn set_prompt(&mut self, template: Option<Line<'static>>)
Set the input ui prefix. The prompt style from the config is used as the base style.
Sourcepub fn set_prompt_line(&mut self, prompt: Line<'static>)
pub fn set_prompt_line(&mut self, prompt: Line<'static>)
Set the input ui prefix directly.
Methods from Deref<Target = InputUI>§
pub fn recompute_graphemes(&mut self)
pub fn byte_index(&self, grapheme_idx: usize) -> usize
pub fn str_at_cursor(&self) -> &str
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn set(&mut self, input: impl Into<Option<String>>, cursor: u16)
pub fn push_char(&mut self, c: char)
pub fn insert_str(&mut self, content: &str)
pub fn push_str(&mut self, content: &str)
pub fn scroll_to_cursor(&mut self, padding: usize)
pub fn cancel(&mut self)
pub fn prepare_column_change(&mut self)
Sourcepub fn set_at_visual_offset(&mut self, visual_offset: u16)
pub fn set_at_visual_offset(&mut self, visual_offset: u16)
Set cursor to a visual offset relative to start position
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 render(&self) -> &str
pub fn cursor_rel_offset(&self) -> u16
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryUI
impl RefUnwindSafe for QueryUI
impl Send for QueryUI
impl Sync for QueryUI
impl Unpin for QueryUI
impl UnsafeUnpin for QueryUI
impl UnwindSafe for QueryUI
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