Trait Is

Source
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§

Source

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));

Implementors§

Source§

impl<T0> Is for orn::or1::Or<T0>

Source§

impl<T0, T1> Is for orn::or2::Or<T0, T1>

Source§

impl<T0, T1, T2> Is for orn::or3::Or<T0, T1, T2>

Source§

impl<T0, T1, T2, T3> Is for orn::or4::Or<T0, T1, T2, T3>

Source§

impl<T0, T1, T2, T3, T4> Is for orn::or5::Or<T0, T1, T2, T3, T4>

Source§

impl<T0, T1, T2, T3, T4, T5> Is for orn::or6::Or<T0, T1, T2, T3, T4, T5>

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Is for orn::or7::Or<T0, T1, T2, T3, T4, T5, T6>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Is for orn::or8::Or<T0, T1, T2, T3, T4, T5, T6, T7>