[−][src]Struct meli::components::utilities::Selector
Shows a little window with options for user to select.
Instantiate with Selector::new(). Set single_only to true if user should only choose one of the options. After passing input events to this component, check Selector::is_done to see if the user has finalised their choices. Collect the choices by consuming the Selector with Selector::collect()
Fields
single_only: bool
allow only one selection
entries: Vec<(T, bool)>
content: CellBuffer
theme_default: ThemeAttribute
cursor: SelectorCursor
vertical_alignment: Alignment
horizontal_alignment: Alignment
title: String
done: bool
If true, user has finished their selection
done_fn: F
dirty: bool
id: ComponentId
Implementations
impl<T: PartialEq + Debug + Clone + Sync + Send, F: 'static + Sync + Send> Selector<T, F>
[src]
pub fn new(
title: &str,
entries: Vec<(T, String)>,
single_only: bool,
done_fn: F,
context: &Context
) -> Selector<T, F>
[src]
title: &str,
entries: Vec<(T, String)>,
single_only: bool,
done_fn: F,
context: &Context
) -> Selector<T, F>
pub fn is_done(&self) -> bool
[src]
pub fn collect(self) -> Vec<T>
[src]
fn draw(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context)
[src]
impl<T: 'static + PartialEq + Debug + Clone + Sync + Send> Selector<T, Option<Box<dyn FnOnce(Uuid, &[T]) + 'static + Sync + Send>>>
[src]
impl Selector<bool, Option<Box<dyn FnOnce(Uuid, bool) + 'static + Sync + Send>>>
[src]
Trait Implementations
impl<T: 'static + PartialEq + Debug + Clone + Sync + Send, F: 'static + Sync + Send> Debug for Selector<T, F>
[src]
impl<T: 'static + PartialEq + Debug + Clone + Sync + Send, F: 'static + Sync + Send> Display for Selector<T, F>
[src]
impl<T: 'static + PartialEq + Debug + Clone + Sync + Send, F: 'static + Sync + Send> PartialEq<Selector<T, F>> for Selector<T, F>
[src]
Auto Trait Implementations
impl<T, F> RefUnwindSafe for Selector<T, F> where
F: RefUnwindSafe,
T: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for Selector<T, F>
impl<T, F> Sync for Selector<T, F>
impl<T, F> Unpin for Selector<T, F> where
F: Unpin,
T: Unpin,
F: Unpin,
T: Unpin,
impl<T, F> UnwindSafe for Selector<T, F> where
F: UnwindSafe,
T: UnwindSafe,
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,