pub struct Selection<'a, T: Send + Sync + 'static> { /* private fields */ }Expand description
The selected items when the picker quits.
This is the return type of the various pick_multi* methods of a Picker.
Iterate over the picked items with iter. If no items were selected, ththe struct
will be empty. Also see the docs on
multiple selections
The lifetime of this struct is bound to the lifetime of the picker from which it originated.
Implementations§
Source§impl<'a, T: Send + Sync + 'static> Selection<'a, T>
impl<'a, T: Send + Sync + 'static> Selection<'a, T>
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = &'a T> + DoubleEndedIterator
pub fn iter(&self) -> impl ExactSizeIterator<Item = &'a T> + DoubleEndedIterator
Returns an iterator over the other selected items.
The iterator contains each selected item exactly once, sorted by index based on the order
in which the picker received the items. Note that items are deduplicated based on the
selection index instead of using any properties of the type T itself.
The iterator will be empty if the picker quit without selecting any items.
Auto Trait Implementations§
impl<'a, T> Freeze for Selection<'a, T>
impl<'a, T> RefUnwindSafe for Selection<'a, T>
impl<'a, T> Send for Selection<'a, T>
impl<'a, T> Sync for Selection<'a, T>
impl<'a, T> Unpin for Selection<'a, T>
impl<'a, T> UnwindSafe for Selection<'a, T>
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> 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