Expand description
Implementations of Exhaust
for standard library types.
The public contents of this module are just the corresponding structs implementing
Iterator
. These need to be public, but should mostly be considered an implementation
detail and not need to be used explicitly.
The following primitive or standard library types do not implement Exhaust
for
particular reasons:
- References, because there’s nowhere to stash the referent.
(This could be changed for small finite types, like
&bool
, but those are the same sort of types which are unlikely to be used by reference.) - Pointers, for the same reason as references (and we could generate invalid pointers, but that would be almost certainly pointless).
u64
,i64
, andf64
, because they are too large to feasibly exhaust.core::cell::UnsafeCell
, because it does not implementClone
.core::mem::ManuallyDrop
, because it would be a memory leak.core::mem::MaybeUninit
, because it is not useful to obtain aMaybeUninit<T>
value without knowing whether it is initialized, and if they are to be all initialized, thenT::exhaust()
is just as good.alloc::vec::Vec
and other collections that permit duplicate items, since their possible values are bounded only by available memory.std::io::ErrorKind
and other explicitly non-exhaustive types.std::io::Stdout
and other types whose sole use is in performing IO.std::sync::Mutex
andRwLock
, which do not implementClone
.
Structs
- Iterator implementation of
[T; N]::exhaust()
. - Iterator implementation of
NonZeroI8::exhaust()
. - Iterator implementation of
NonZeroI16::exhaust()
. - Iterator implementation of
NonZeroI32::exhaust()
. - Iterator implementation of
NonZeroU8::exhaust()
. - Iterator implementation of
NonZeroU16::exhaust()
. - Iterator implementation of
NonZeroU32::exhaust()
. - Iterator implementation for
Result::exhaust()
. - Iterator over all tuples of 2 elements.
- Iterator over all tuples of 3 elements.
- Iterator over all tuples of 4 elements.
- Iterator over all tuples of 5 elements.
- Iterator over all tuples of 6 elements.
- Iterator over all tuples of 7 elements.
- Iterator over all tuples of 8 elements.
- Iterator over all tuples of 9 elements.
- Iterator over all tuples of 10 elements.
- Iterator over all tuples of 11 elements.
- Iterator over all tuples of 12 elements.