disjoint_impls 1.4.0

Support for mutually disjoint impls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use disjoint_impls::disjoint_impls;

trait Supertrait<const FLAG: bool> {}

impl Supertrait<true> for u8 {}
impl Supertrait<false> for u16 {}

disjoint_impls! {
    trait Encode<const FLAG: bool>: Supertrait<FLAG> {
        const VALUE: bool;
    }

    impl Encode<true> for u8 {
        const VALUE: bool = true;
    }
}

fn main() {}