Trait Exhaust

Source
pub trait Exhaust: Sized {
    type Iter: FusedIterator<Item = Self::Factory> + Clone + Debug;
    type Factory: Clone + Debug;

    // Required methods
    fn exhaust_factories() -> Self::Iter;
    fn from_factory(factory: Self::Factory) -> Self;

    // Provided method
    fn exhaust() -> Iter<Self>  { ... }
}
Expand description

Types that can be exhaustively iterated. That is, an iterator is available which produces every possible value of this type.

§Properties

Implementations must have the following properties:

  • Exhaustiveness: If Self: PartialEq, then for every value a of type Self, there is some element b of Self::exhaust() for which a == b, unless it is the case that a != a.

    If there is no PartialEq implementation, then follow the spirit of this rule anyway.

  • No duplicates: if Self: PartialEq, then for any two items a, b produced by the iterator, a != b.

    If this rule comes into conflict with exhaustiveness, then exhaustiveness takes priority.

  • If there is any value a of type Self for which a != a, then Exhaust must produce one or more such values (e.g. f32::NAN).

  • The iterator has a finite length.

    For example, collections which can contain arbitrary numbers of duplicate elements, like Vec, should not implement Exhaust, because they cannot have an iterator which is both finite and exhaustive.

  • Purity/determinism: every call to Self::exhaust(), or Clone::clone() of a returned iterator or factory, should produce the same sequence of items.

    (If this is not upheld, then derived implementations of Exhaust on types containing this type will not behave consistently.)

  • exhaust() does not panic, nor does the iterator it returns, except in the event that memory allocation fails.

  • All produced values should be valid according to Self’s invariants as enforced by its ordinary constructors. When the above properties refer to “a value of type Self”, they do not include invalid values.

The following further properties are recommended when feasible:

  • If Self: Ord, then the items are sorted in ascending order.

  • The iterator’s length makes it feasible to actually exhaust.

    For example, u64 does not implement Exhaust. This may be infeasible to ensure in compositions; e.g. [u16; 4] is even more infeasible to exhaust than u64.

Exhaust is not an unsafe trait, and as such, no soundness property should rest on implementations having any of the above properties unless the particular implementation guarantees them.

§Examples

Using derive(Exhaust) to implement the trait:

use exhaust::Exhaust;

#[derive(PartialEq, Debug, Exhaust)]
struct Foo {
    a: bool,
    b: Bar,
}

#[derive(PartialEq, Debug, Exhaust)]
enum Bar {
    One,
    Two(bool),
}

assert_eq!(
    Foo::exhaust().collect::<Vec<Foo>>(),
    vec![
        Foo { a: false, b: Bar::One },
        Foo { a: false, b: Bar::Two(false) },
        Foo { a: false, b: Bar::Two(true) },
        Foo { a: true, b: Bar::One },
        Foo { a: true, b: Bar::Two(false) },
        Foo { a: true, b: Bar::Two(true) },
    ],
);

Writing a manual implementation of Exhaust:

use exhaust::Exhaust;

#[derive(Clone, Debug)]
struct AsciiLetter(char);

impl Exhaust for AsciiLetter {
    type Iter = ExhaustAsciiLetter;

    // We could avoid needing to `derive(Clone, Debug)` by using `char` as the factory,
    // but if we did that, then `from_factory()` must check its argument for validity.
    type Factory = Self;

    fn exhaust_factories() -> Self::Iter {
        ExhaustAsciiLetter { next: 'A' }
    }

    fn from_factory(factory: Self::Factory) -> Self {
        factory
    }
}

#[derive(Clone, Debug)]  // All `Exhaust::Iter`s must implement `Clone` and `Debug`.
struct ExhaustAsciiLetter {
    next: char
}

impl Iterator for ExhaustAsciiLetter {
    type Item = AsciiLetter;

    fn next(&mut self) -> Option<Self::Item> {
        match self.next {
            'A'..='Y' | 'a'..='z' => {
                let item = self.next;
                self.next = char::from_u32(self.next as u32 + 1).unwrap();
                Some(AsciiLetter(item))
            }
            'Z' => {
                self.next = 'a';
                Some(AsciiLetter('Z'))
            }
            '{' => None,  // ('z' + 1)
            _ => unreachable!(),
        }
    }
}
impl std::iter::FusedIterator for ExhaustAsciiLetter {}

assert_eq!(
    AsciiLetter::exhaust().map(|l| l.0).collect::<String>(),
    String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"),
);

§Excluded Types

The following primitive or standard library types do not implement Exhaust for particular reasons:

Required Associated Types§

Source

type Iter: FusedIterator<Item = Self::Factory> + Clone + Debug

Iterator type returned by Self::exhaust_factories(). See the trait documentation for what properties this iterator should have.

Note: While it is necessary for this type to be exposed, an implementation of Exhaust changing to another iterator type should not be considered a breaking change, as long as it still has the same iterator properties (e.g. ExactSizeIterator); it should be treated as an implementation detail.

Source

type Factory: Clone + Debug

Data which can be used to construct Self.

The difference between Self and Self::Factory is that the Factory must implement Clone, while Self is not required to. This is relevant to, and motivated by, the following cases:

  • Types which do not implement Clone, or which conditionally implement Clone, can still implement Exhaust by providing a Factory type which is not Self. For example, interior-mutable types often do not implement Clone, or implement it so as to make a new handle to existing shared state; those types should choose a Factory type which represents their initial state only.

  • Generic containers of two or more values need to generate all combinations of their values. The guarantee that the contents’ Factory is Clone allows them to use clones of the factories to perform this iteration straightforwardly. (It would be theoretically possible to avoid this by cloning the exhausting iterators themselves, but much more complex and difficult to implement correctly.) For example, [AtomicBool; 2] ends up using [bool; 2] as its factory, which implements Clone even though AtomicBool does not.

  • A lot of wrapper types can easily implement Exhaust by delegating to another iterator and merely implementing Self::from_factory() to add the wrapper. This is not more powerful than use of Iterator::map(), but it is often more convenient.

Types which implement Clone and are not generic can use type Factory = Self; if they wish.

Note: While it is necessary for this type to be exposed, an implementation of Exhaust changing to another factory type should not be considered a breaking change; it should be treated as an implementation detail, unless otherwise documented.

Required Methods§

Source

fn exhaust_factories() -> Self::Iter

Returns an iterator over factories for all values of this type.

Implement this function to implement the trait. Call this function when implementing an Exhaust::Iter iterator for a type that contains this type.

See the trait documentation for what properties this iterator should have.

Source

fn from_factory(factory: Self::Factory) -> Self

Construct a concrete value of this type from a Self::Factory value produced by its Self::Iter.

Caution: While this function is meant to be used only with values produced by the iterator, this cannot be enforced; therefore, make sure it cannot bypass any invariants that the type might have.

§Panics
  • This function may panic if given a factory value that is not one of the values Self::Iter is able to produce.
  • This function may panic or abort if memory allocation that is required to construct Self fails.

Implementations should not panic under any other circumstances.

Provided Methods§

Source

fn exhaust() -> Iter<Self>

Returns an iterator over all values of this type.

See the trait documentation for what properties this iterator should have.

This function is equivalent to Self::exhaust_factories().map(Self::from_factory). Implementors should not override it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Exhaust for Ordering

Source§

type Iter = IntoIter<Ordering, { $array.len() }>

Source§

type Factory = Ordering

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for Infallible

Source§

impl Exhaust for Alignment

Source§

type Iter = <Alignment as Exhaust>::Iter

Source§

type Factory = <Alignment as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for FpCategory

Source§

type Iter = IntoIter<FpCategory, { $array.len() }>

Source§

type Factory = FpCategory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for RecvTimeoutError

Source§

impl Exhaust for TryRecvError

Source§

type Iter = IntoIter<TryRecvError, { $array.len() }>

Source§

type Factory = TryRecvError

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for bool

Source§

type Iter = IntoIter<bool, { $array.len() }>

Source§

type Factory = bool

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for char

Source§

impl Exhaust for f32

Note: The floats produced include many NaNs (all unequal in representation).

Source§

impl Exhaust for i8

Source§

impl Exhaust for i16

Source§

impl Exhaust for i32

Source§

impl Exhaust for u8

Source§

impl Exhaust for u16

Source§

impl Exhaust for u32

Source§

impl Exhaust for ()

Source§

type Iter = Once<()>

Source§

type Factory = ()

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for Error

Source§

impl Exhaust for PhantomPinned

Source§

impl Exhaust for NonZero<i8>

Source§

type Iter = ExhaustNonZero<i8, NonZero<i8>>

Source§

type Factory = NonZero<i8>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for NonZero<i16>

Source§

type Iter = ExhaustNonZero<i16, NonZero<i16>>

Source§

type Factory = NonZero<i16>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for NonZero<i32>

Source§

type Iter = ExhaustNonZero<i32, NonZero<i32>>

Source§

type Factory = NonZero<i32>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for NonZero<u8>

Source§

type Iter = ExhaustNonZero<u8, NonZero<u8>>

Source§

type Factory = NonZero<u8>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for NonZero<u16>

Source§

type Iter = ExhaustNonZero<u16, NonZero<u16>>

Source§

type Factory = NonZero<u16>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for NonZero<u32>

Source§

type Iter = ExhaustNonZero<u32, NonZero<u32>>

Source§

type Factory = NonZero<u32>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for RangeFull

Source§

impl Exhaust for AtomicBool

Source§

impl Exhaust for AtomicI8

Source§

type Iter = <i8 as Exhaust>::Iter

Source§

type Factory = <i8 as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for AtomicI16

Source§

impl Exhaust for AtomicI32

Source§

impl Exhaust for AtomicU8

Source§

type Iter = <u8 as Exhaust>::Iter

Source§

type Factory = <u8 as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for AtomicU16

Source§

impl Exhaust for AtomicU32

Source§

impl Exhaust for Stderr

Source§

impl Exhaust for Stdin

Source§

impl Exhaust for Stdout

Source§

impl Exhaust for Empty

Source§

impl Exhaust for Repeat

Source§

type Iter = <u8 as Exhaust>::Iter

Source§

type Factory = <u8 as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl Exhaust for Sink

Source§

impl Exhaust for RecvError

Source§

impl<B: Exhaust, C: Exhaust> Exhaust for ControlFlow<B, C>

Source§

type Iter = <ControlFlow<B, C> as Exhaust>::Iter

Source§

type Factory = <ControlFlow<B, C> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<H> Exhaust for BuildHasherDefault<H>

Source§

impl<K, V, S> Exhaust for HashMap<K, V, S>
where K: Exhaust + Eq + Hash, V: Exhaust, S: Default + BuildHasher,

Source§

type Iter = ExhaustMap<<HashSet<K, S> as Exhaust>::Iter, V>

Source§

type Factory = Vec<(<K as Exhaust>::Factory, <V as Exhaust>::Factory)>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<K: Exhaust + Ord, V: Exhaust> Exhaust for BTreeMap<K, V>

Source§

type Iter = ExhaustMap<<BTreeSet<K> as Exhaust>::Iter, V>

Source§

type Factory = Vec<(<K as Exhaust>::Factory, <V as Exhaust>::Factory)>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1> Exhaust for (T0, T1)
where T0: Exhaust, T1: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2> Exhaust for (T0, T1, T2)
where T0: Exhaust, T1: Exhaust, T2: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3> Exhaust for (T0, T1, T2, T3)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4> Exhaust for (T0, T1, T2, T3, T4)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5> Exhaust for (T0, T1, T2, T3, T4, T5)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Exhaust for (T0, T1, T2, T3, T4, T5, T6)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust, T6: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5, T6>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory, <T6 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Exhaust for (T0, T1, T2, T3, T4, T5, T6, T7)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust, T6: Exhaust, T7: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5, T6, T7>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory, <T6 as Exhaust>::Factory, <T7 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Exhaust for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust, T6: Exhaust, T7: Exhaust, T8: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5, T6, T7, T8>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory, <T6 as Exhaust>::Factory, <T7 as Exhaust>::Factory, <T8 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Exhaust for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust, T6: Exhaust, T7: Exhaust, T8: Exhaust, T9: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory, <T6 as Exhaust>::Factory, <T7 as Exhaust>::Factory, <T8 as Exhaust>::Factory, <T9 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Exhaust for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust, T6: Exhaust, T7: Exhaust, T8: Exhaust, T9: Exhaust, T10: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory, <T6 as Exhaust>::Factory, <T7 as Exhaust>::Factory, <T8 as Exhaust>::Factory, <T9 as Exhaust>::Factory, <T10 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Exhaust for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
where T0: Exhaust, T1: Exhaust, T2: Exhaust, T3: Exhaust, T4: Exhaust, T5: Exhaust, T6: Exhaust, T7: Exhaust, T8: Exhaust, T9: Exhaust, T10: Exhaust, T11: Exhaust,

Source§

type Iter = ExhaustTupleIter<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>

Source§

type Factory = (<T0 as Exhaust>::Factory, <T1 as Exhaust>::Factory, <T2 as Exhaust>::Factory, <T3 as Exhaust>::Factory, <T4 as Exhaust>::Factory, <T5 as Exhaust>::Factory, <T6 as Exhaust>::Factory, <T7 as Exhaust>::Factory, <T8 as Exhaust>::Factory, <T9 as Exhaust>::Factory, <T10 as Exhaust>::Factory, <T11 as Exhaust>::Factory)

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for (T,)
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Box<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Rc<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Arc<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Cell<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for RefCell<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for UnsafeCell<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Reverse<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Pending<T>

Source§

impl<T> Exhaust for Ready<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for PhantomData<T>

Source§

impl<T> Exhaust for Wrapping<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Pin<Box<T>>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Pin<Rc<T>>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Pin<Arc<T>>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for SendError<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for Mutex<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T> Exhaust for RwLock<T>
where T: Exhaust,

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T, S> Exhaust for HashSet<T, S>
where T: Exhaust + Eq + Hash, S: Default + BuildHasher,

Source§

type Iter = ExhaustSet<T>

Source§

type Factory = Vec<<T as Exhaust>::Factory>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Read + Exhaust> Exhaust for BufReader<T>

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Read + Exhaust, U: Read + Exhaust> Exhaust for Chain<T, U>

Source§

impl<T: Write + Exhaust> Exhaust for BufWriter<T>

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Write + Exhaust> Exhaust for LineWriter<T>

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust + Ord> Exhaust for BTreeSet<T>

Source§

type Iter = ExhaustSet<T>

Source§

type Factory = Vec<<T as Exhaust>::Factory>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust + AsRef<[u8]> + Clone + Debug> Exhaust for Cursor<T>

Produces each combination of a buffer state and a cursor position, except for those where the position is beyond the end of the buffer.

Source§

type Iter = FlatZipMap<Iter<T>, RangeInclusive<u64>, Cursor<T>>

Source§

type Factory = Cursor<T>

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for Bound<T>

Source§

type Iter = <Bound<T> as Exhaust>::Iter

Source§

type Factory = <Bound<T> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for Option<T>

Source§

type Iter = <Option<T> as Exhaust>::Iter

Source§

type Factory = <Option<T> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for Poll<T>

Source§

type Iter = <Option<T> as Exhaust>::Iter

Source§

type Factory = <Option<T> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for TrySendError<T>

Source§

type Iter = <TrySendError<T> as Exhaust>::Iter

Source§

type Factory = <TrySendError<T> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for OnceCell<T>

Source§

type Iter = <Option<T> as Exhaust>::Iter

Source§

type Factory = <Option<T> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for RangeFrom<T>

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for RangeTo<T>

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for RangeToInclusive<T>

Source§

type Iter = <T as Exhaust>::Iter

Source§

type Factory = <T as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust> Exhaust for OnceLock<T>

Source§

type Iter = <Option<T> as Exhaust>::Iter

Source§

type Factory = <Option<T> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust, E: Exhaust> Exhaust for Result<T, E>

Source§

type Iter = <Result<T, E> as Exhaust>::Iter

Source§

type Factory = <Result<T, E> as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: Exhaust, const N: usize> Exhaust for [T; N]

Source§

type Iter = ExhaustArray<T, N>

Source§

type Factory = [<T as Exhaust>::Factory; N]

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Source§

impl<T: ?Sized + ToOwned<Owned = O>, O: Exhaust> Exhaust for Cow<'_, T>

Note that this implementation necessarily ignores the borrowed versus owned distinction; every value returned will be a Cow::Owned, not a Cow::Borrowed. This agrees with the PartialEq implementation for Cow, which considers owned and borrowed to be equal.

Source§

type Iter = <O as Exhaust>::Iter

Source§

type Factory = <O as Exhaust>::Factory

Source§

fn exhaust_factories() -> Self::Iter

Source§

fn from_factory(factory: Self::Factory) -> Self

Implementors§