pub struct ComboboxState<T: Clone + PartialEq + 'static> {
pub selected: Option<T>,
/* private fields */
}Expand description
The stateful combobox. Build one with ComboboxState::new inside
cx.new(…); it has to outlive a frame because it owns two entities.
Fields§
§selected: Option<T>The chosen value. None while the text names nothing.
Implementations§
Source§impl<T: Clone + PartialEq + 'static> ComboboxState<T>
impl<T: Clone + PartialEq + 'static> ComboboxState<T>
Trait Implementations§
Source§impl<T: Clone + PartialEq + 'static> Accessible for ComboboxState<T>
The wrapper carries the role, not the TextField inside it: TextField
reports no role of its own, and teaching it one here would give a role to
every plain text field in the crate — a separate decision, and a wrong one
to take by side effect.
impl<T: Clone + PartialEq + 'static> Accessible for ComboboxState<T>
The wrapper carries the role, not the TextField inside it: TextField
reports no role of its own, and teaching it one here would give a role to
every plain text field in the crate — a separate decision, and a wrong one
to take by side effect.
The value is the text, not the chosen label. While the two agree that is the same string; while the user is typing, the text is what is on screen and is what a screen reader should read back.
impl<T: Clone + PartialEq + 'static> EventEmitter<ComboboxChanged> for ComboboxState<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ComboboxState<T>
impl<T> !Send for ComboboxState<T>
impl<T> !Sync for ComboboxState<T>
impl<T> !UnwindSafe for ComboboxState<T>
impl<T> Freeze for ComboboxState<T>
impl<T> Unpin for ComboboxState<T>
impl<T> UnsafeUnpin for ComboboxState<T>where
Vec<(T, SharedString)>: UnsafeUnpin,
Option<T>: UnsafeUnpin,
Option<Rc<dyn Fn(Option<T>, &mut Window, &mut App)>>: UnsafeUnpin,
Rc<dyn Fn(&str, &T, &SharedString) -> bool>: UnsafeUnpin,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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