1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::{Arguments, AsIter};

pub trait Directive<const CONST: bool> {
    type Arguments: Arguments<CONST>;

    fn name(&self) -> &str;
    fn arguments(&self) -> Option<&Self::Arguments>;
}

pub trait ConstDirective: Directive<true> {}
impl<T: Directive<true>> ConstDirective for T {}

pub trait VariableDirective: Directive<false> {}
impl<T: Directive<false>> VariableDirective for T {}

pub trait Directives<const CONST: bool>: AsIter<Item = Self::Directive> {
    type Directive: Directive<CONST>;
}

pub trait ConstDirectives: Directives<true> {}
impl<T: Directives<true>> ConstDirectives for T {}

pub trait VariableDirectives: Directives<false> {}
impl<T: Directives<false>> VariableDirectives for T {}