Crate misfortunate

Source

Structs§

Always
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
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
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
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
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.
Everything
Everything claims specifically to be equal to anything, via PartialEq
Funhouse
Funhouse wraps any existing type which implements PartialEq. However Funhouse implements both eq and ne identically resulting in a contradiction.
Jumble
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
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.
Loaner
Loaner wraps any Default type but when you ask for a reference all you get is a reference to that default. This also works for mutable borrows.
Maxwell
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
Mirror
Mirror wraps any existing type which implements PartialEq. However Mirror implements eq opposite to its conventional meaning.
Multiplicity
Multiplicity claims to implement Clone but the clones are all just Default.
Nice
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.
Nothing
Nothing claims specifically not to be equal to anything, via PartialEq
OnewayEqual
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
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
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.
Pristine
Pristine implements std::fmt::Write by just always reporting an error.
Reverse
Reverse wraps any existing type which claims to have total order via Ord. It just reverses that order. This is very similar to std::cmp::Reverse.