or_type

Crates.ioor_type
lib.rsor_type
version0.1.0
sourcesrc
created_at2021-04-17 11:20:26.550156
updated_at2021-04-17 11:20:26.550156
descriptionGeneric either-or type
homepagehttps://gitlab.com/8BitKitKat/rust-or-type
repository
max_upload_size
id385713
size4,041
Ketan Reynolds (tealsnow)

documentation

README

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 {})
    }
}
Commit count: 0

cargo fmt