A generic implementation of a sum type (or discriminated union). It provides enum Or<T1, T2, ..., N> types as a counterpart to tuples.
Features
- has
#![no_std]and#![forbid(unsafe_code)] - supports the applicable core traits
features = ["iter"](default): supports theInto/Iteratortraitsfeatures = ["future"](default): supports theInto/Futuretraitsfeatures = ["serde"]: supports theSerializeandDeserializetraitsfeatures = ["rayon"]: supports theParallelIteratorfamily of traitsfeatures = ["or16"]: for up toOr16features = ["or32"]: for up toOr32
Cheat Sheet
use *;
/// Using the `tn` methods, items of an `Or` value can be retrieved.
/// Using the `At<I>` trait, items of an `Or` value can be retrieved
/// generically.
/// Often, the type of iterator is conditional to some input value. Typically,
/// to unify the return type, one would need to implement a custom iterator, but
/// here `orn` types are used instead.
use *;
/// With `features = ["rayon"]`, `rayon`'s `ParallelIterator` family of traits
/// can be used similarly to the `Iterator` trait.