bluejay_core/
directive.rs1use crate::{Arguments, AsIter};
2
3pub trait Directive<const CONST: bool> {
4 type Arguments: Arguments<CONST>;
5
6 fn name(&self) -> &str;
7 fn arguments(&self) -> Option<&Self::Arguments>;
8}
9
10pub trait ConstDirective: Directive<true> {}
11impl<T: Directive<true>> ConstDirective for T {}
12
13pub trait VariableDirective: Directive<false> {}
14impl<T: Directive<false>> VariableDirective for T {}
15
16pub trait Directives<const CONST: bool>: AsIter<Item = Self::Directive> {
17 type Directive: Directive<CONST>;
18}
19
20pub trait ConstDirectives: Directives<true> {}
21impl<T: Directives<true>> ConstDirectives for T {}
22
23pub trait VariableDirectives: Directives<false> {}
24impl<T: Directives<false>> VariableDirectives for T {}