pub struct TextInput { /* private fields */ }Implementations§
Source§impl TextInput
impl TextInput
pub fn new(keybindings: Keybindings) -> Self
pub fn set_content_width(&mut self, width: usize)
pub fn buffer(&self) -> &str
Sourcepub fn cursor_index(&self, picker_query_len: Option<usize>) -> usize
pub fn cursor_index(&self, picker_query_len: Option<usize>) -> usize
Returns the visual cursor index, accounting for an active file picker
whose query extends beyond the @ trigger character.
pub fn take_mentions(&mut self) -> Vec<SelectedFileMention>
pub fn set_input(&mut self, s: String)
pub fn clear(&mut self)
pub fn insert_char_at_cursor(&mut self, c: char)
pub fn delete_char_before_cursor(&mut self) -> bool
pub fn insert_paste(&mut self, text: &str)
pub fn apply_file_selection(&mut self, path: PathBuf, display_name: String)
Trait Implementations§
Source§impl Component for TextInput
impl Component for TextInput
Source§type Message = TextInputMessage
type Message = TextInputMessage
The message type emitted by this widget.
Source§async fn on_event(&mut self, event: &Event) -> Option<Vec<Self::Message>>
async fn on_event(&mut self, event: &Event) -> Option<Vec<Self::Message>>
Process an event and return the outcome. Read more
Source§fn render(&mut self, _context: &ViewContext) -> Frame
fn render(&mut self, _context: &ViewContext) -> Frame
Render the current state to a frame.
Auto Trait Implementations§
impl Freeze for TextInput
impl RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl UnsafeUnpin for TextInput
impl UnwindSafe for TextInput
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more