1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright © 2026 Mikhail Hogrefe
//
// This file is part of Malachite.
//
// Malachite is free software: you can redistribute it and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published by the Free Software Foundation; either version
// 3 of the License, or (at your option) any later version. See <https://www.gnu.org/licenses/>.
use ;
/// Generates all [`Option`]s except `None`, with values from a given iterator.
///
/// This `struct` is created by [`exhaustive_somes`]; see its documentation for more.
/// Generates all [`Option`]s except `None`, with values from a given iterator.
///
/// The elements of the given iterator are wrapped in `Some` and generated in the original order.
///
/// The output length is `xs.count()`.
///
/// # Examples
/// ```
/// use itertools::Itertools;
/// use malachite_base::options::exhaustive::exhaustive_somes;
///
/// assert_eq!(
/// exhaustive_somes([1, 2, 3].iter().cloned()).collect_vec(),
/// &[Some(1), Some(2), Some(3)]
/// );
/// ```
pub const
/// Generates all [`Option`]s with values from a given iterator.
///
/// `None` comes first, followed by the elements of the given iterator wrapped in `Some`.
///
/// The output length is `xs.count()`.
///
/// # Examples
/// ```
/// use itertools::Itertools;
/// use malachite_base::options::exhaustive::exhaustive_options;
///
/// assert_eq!(
/// exhaustive_options([1, 2, 3].iter().cloned()).collect_vec(),
/// &[None, Some(1), Some(2), Some(3)]
/// );
/// ```