Struct requestty_ui::widgets::Select
source · [−]pub struct Select<L> {
pub list: L,
/* private fields */
}
Expand description
A widget to select a single item from a list.
The list must implement the List
trait.
Fields
list: L
The underlying list
Implementations
sourceimpl<L: List> Select<L>
impl<L: List> Select<L>
sourcepub fn set_at(&mut self, at: usize)
pub fn set_at(&mut self, at: usize)
Set the index of the element that is currently being hovered.
at
can be any number (even beyond list.len()
), but the caller is responsible for making
sure that it is a selectable element.
sourcepub fn into_inner(self) -> L
pub fn into_inner(self) -> L
Consumes the Select
returning the original list.
Trait Implementations
sourceimpl<L: List> Widget for Select<L>
impl<L: List> Widget for Select<L>
sourcefn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
fn cursor_pos(&mut self, layout: Layout) -> (u16, u16)
Returns the starting location of the layout. It should not be relied upon for a sensible cursor position.
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<L> RefUnwindSafe for Select<L> where
L: RefUnwindSafe,
impl<L> Send for Select<L> where
L: Send,
impl<L> Sync for Select<L> where
L: Sync,
impl<L> Unpin for Select<L> where
L: Unpin,
impl<L> UnwindSafe for Select<L> where
L: 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