AnyOf<L, R> : Neither | Either<L, R> | Both<L, R>
My first crate mature enough to talk about:
any_of.
ℹ️ This library allows you to use the AnyOf type, which is a sum type of a product type of two types.
ℹ️ It enables you to represent anything in a type-safe manner. It is an algebraic data type (on Wikipedia).
✏️ Formally, it can be written as:AnyOf<L, R> = Neither | Either<L, R> | Both<L, R>
✏️ The Either and Both types allow different combinations of types:Either<L, R> = Left(L) | Right(R)Both<L, R> = (L, R)
✏️ The traits LeftOrRight, Unwrap, Map, and Swap provide extensibility to the library.
The type diagram: