Always claims to have total order and thus implements Ord, regardless of the inner type.
Always in some sense violates the social contract of Ord, as a result safe Rust might have
behaviour which is unexpected or undesired when given a Always instead of something that really
has total order, but it must not become unsafe.
BlackHole implements std::io::Read and std::io::Write and std::fmt::Write
by successfully ignoring anything you Write and reporting that there was nothing to Read.
It also implements Extend by consuming and discarding everything you add
and std::iter::FromIterator by consuming the entire iterator.
Finally, it implements [FromStr] and thus we can parse any string to get a BlackHole.
Comte claims to be an ExactSizeIterator.
At first Comte claims to be empty and if iterated returns None.
However, Comte is not fused and after a tap it will subsequently give
back cloned rabbits forever.
Double is a “smart pointer” in the sense that it implements Deref and DerefMut
however they don’t lead to the same inner object.
You can switch which is which by calling Double::swap()
Echo claims to have total order and thus implements Ord, for any inner type which
implements Ord.
However it actually answers the previous question each time a comparison is performed.
Jumble claims to have total order and thus implements Ord, for any inner type.
However it actually chooses a different Ordering for each comparison regardless
LoadLetter implements std::io::Read and std::io::Write by just always reporting an
error. LoadLetter violates the social contracts of Read and Write, and as a result your
program may have undesirable behaviour if you try to use a LoadLetter.
Maxwell claims both to have equivalence (Eq) and be suitable for hashing (Hash)
yet violates the social contract of these two combined.
A Maxwell is not equal to anything (even itself) but all Maxwells hash the same
Nice claims to be suitable for Iterator::product and Iterator::sum
by implementing the traits Sum and Product over itself for a u8
In fact the value of either “calculation” will always be 69_u8. Nice.
OnewayEqual claims to have total order and thus implements Ord, regardless of the inner type.
However it will always be Equal to anything it can be compared to.
OnewayGreater claims to have total order and thus implements Ord, regardless of the inner type.
However it will always be Greater than anything it can be compared to.
OnewayLess claims to have total order and thus implements Ord, regardless of the inner type.
However it will always be Less than anything it can be compared to.