pub trait TryIntoNonEmptyIterator: Sealed {
type Item;
type IntoNonEmptyIter: NonEmptyIterator<Item = Self::Item>;
// Required method
fn try_into_non_empty_iter(self) -> Option<Self::IntoNonEmptyIter>;
}Expand description
Convenience trait implemented for any type that is IntoIterator,
allowing to convert iterables into non-empty ones.
Required Associated Types§
Sourcetype IntoNonEmptyIter: NonEmptyIterator<Item = Self::Item>
type IntoNonEmptyIter: NonEmptyIterator<Item = Self::Item>
Which kind of NonEmptyIterator are we turning this into?
Required Methods§
Sourcefn try_into_non_empty_iter(self) -> Option<Self::IntoNonEmptyIter>
fn try_into_non_empty_iter(self) -> Option<Self::IntoNonEmptyIter>
Tries to convert self into NonEmptyIterator.
Returns None if self is empty and therefore can not be converted.