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: LThe underlying list
Implementations§
Source§impl<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§
Source§impl<L: List> Widget for Select<L>
impl<L: List> Widget for Select<L>
Source§fn 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.
Source§fn 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> Freeze for Select<L>where
L: Freeze,
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§
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