pub type AnyRule<'rule, 'input, In, Out> = &'rule dyn Rule<'input, In, Output = Out>;
Expand description
Alias for a refernce to a dyn
Rule object of a given type and output.
You can use this with an as
cast in a match
statement to allow each statement to be a separate rule:
ⓘ
t: (char, char) = Any, match arg_0 {
'a' => &'b' as AnyRule<str, char>,
'b' => &Any as AnyRule<str, char>,
other => &Fail(Unexpected::new(other)) as AnyRule<str, char>
};