pub enum ActionToken<'a> {
Word(&'a str),
Flag(Flag),
Str(Cow<'a, str>),
Id(Option<Cow<'a, str>>),
Bool(bool),
Number(usize),
Char(char),
Group(Vec<ActionToken<'a>>),
}Variants§
Word(&'a str)
A bare, unquoted word in the input.
Flag(Flag)
An action-specific flag in the input.
Str(Cow<'a, str>)
A quoted string in the input.
Special characters can be escaped in the same way they are within Rust strings.
Id(Option<Cow<'a, str>>)
An {id} in the input that expands in the action! macro to an identifier.
This will be None when the input is {}, and a positional argument will
be used from the macro arguments instead.
Bool(bool)
A boolean in the input.
This will always be either true or false in the input.
Number(usize)
A number in the input.
This can be a simple number like 5 or 1234567, or one prefixed with 0x, 0o, or 0b
in order to parse the suffix in base 16, 8 or 2 respectively.
Char(char)
A character in the input surrounded by single quotes (e.g., 'c').
Special characters can be escaped in the same way they are within Rust.
Group(Vec<ActionToken<'a>>)
A collection of tokens between parenthesis (e.g. (foo bar 5)).
Implementations§
Source§impl ActionToken<'_>
impl ActionToken<'_>
Sourcepub fn bind_positional<E, F>(&mut self, f: &mut F) -> Result<(), E>
pub fn bind_positional<E, F>(&mut self, f: &mut F) -> Result<(), E>
Provide identifiers for each of the positional {} arguments nested within this ActionToken.