Struct requestty_ui::widgets::CharInput
source · [−]pub struct CharInput<F = FilterMapChar> { /* private fields */ }
Expand description
A widget that inputs a single character.
A filter_map
function can optionally be provided to limit and change the characters allowed,
similar to Iterator::filter_map
.
If multiple characters are received, they will overwrite the previous character. If a
multi-character string is required, use StringInput
.
Implementations
Trait Implementations
sourceimpl<F> Widget for CharInput<F> where
F: Fn(char) -> Option<char>,
impl<F> Widget for CharInput<F> where
F: Fn(char) -> Option<char>,
sourcefn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
fn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
Returns the position right after the character if any.
sourcefn handle_key(&mut self, key: KeyEvent) -> bool
fn handle_key(&mut self, key: KeyEvent) -> bool
Handle a key input. It should return whether key was handled.
Auto Trait Implementations
impl<F> RefUnwindSafe for CharInput<F> where
F: RefUnwindSafe,
impl<F> Send for CharInput<F> where
F: Send,
impl<F> Sync for CharInput<F> where
F: Sync,
impl<F> Unpin for CharInput<F> where
F: Unpin,
impl<F> UnwindSafe for CharInput<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more