pub struct DropdownState {
pub options: Vec<PickerItem>,
pub selection: SelectionModel,
pub filter: String,
pub cursor: usize,
pub mode: PickerMode,
pub create_buffer: String,
}Fields§
§options: Vec<PickerItem>§selection: SelectionModel§filter: String§cursor: usize§mode: PickerMode§create_buffer: StringImplementations§
Source§impl DropdownState
impl DropdownState
pub fn single(options: Vec<PickerItem>) -> Self
pub fn multi(options: Vec<PickerItem>) -> Self
pub fn visible_indices(&self) -> Vec<usize>
Sourcepub fn seed_single(&mut self, value: &str)
pub fn seed_single(&mut self, value: &str)
Seed a single-select dropdown on value: record it as the selection and put
the cursor on its option. A no-op when value is empty or names no option, so
a caller can seed from a criterion that is unset or stale.
pub fn handle_key(&mut self, key: KeyCode) -> PickerEvent
Trait Implementations§
Source§impl Clone for DropdownState
impl Clone for DropdownState
Source§impl Debug for DropdownState
impl Debug for DropdownState
impl Eq for DropdownState
Source§impl PartialEq for DropdownState
impl PartialEq for DropdownState
impl StructuralPartialEq for DropdownState
Auto Trait Implementations§
impl Freeze for DropdownState
impl RefUnwindSafe for DropdownState
impl Send for DropdownState
impl Sync for DropdownState
impl Unpin for DropdownState
impl UnsafeUnpin for DropdownState
impl UnwindSafe for DropdownState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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