pub trait Is {
// Required method
fn is(&self, index: usize) -> bool;
}Expand description
A trait for checking if an Or value is of a certain variant by index.
Required Methods§
Sourcefn is(&self, index: usize) -> bool
fn is(&self, index: usize) -> bool
Returns true if the Or value corresponds to the given variant
index.
§Examples
use orn::{Is, Or2};
let value: Or2<u8, &str> = Or2::T0(42);
assert!(value.is(0));
assert!(!value.is(1));
let value: Or2<u8, &str> = Or2::T1("hello");
assert!(!value.is(0));
assert!(value.is(1));