or_type 0.1.0

Generic either-or type
Documentation
  • Coverage
  • 50%
    3 out of 6 items documented1 out of 4 items with examples
  • Size
  • Source code size: 3.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.39 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tealsnow

Or

Generic either-or type, similar to Result but more generic

Usage

fn get_foo_or_bar(b: bool) -> Or<Foo, Bar> {
    if b {
        Or::Left(Foo {})
    } else {
        Or::Right(Bar {})
    }
}