pub struct SelectMenu { /* private fields */ }Expand description
选择菜单组件
Implementations§
Source§impl SelectMenu
impl SelectMenu
Sourcepub fn new(prompt: &str, items: Vec<SelectItem>) -> Self
pub fn new(prompt: &str, items: Vec<SelectItem>) -> Self
创建新的选择菜单
Sourcepub fn get_selected(&self) -> usize
pub fn get_selected(&self) -> usize
获取选中项索引
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SelectMenu
impl !RefUnwindSafe for SelectMenu
impl !Send for SelectMenu
impl !Sync for SelectMenu
impl Unpin for SelectMenu
impl UnsafeUnpin for SelectMenu
impl !UnwindSafe for SelectMenu
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