pub enum CommandEvent<'src> {
Command {
name: &'src str,
span: SourceSpan,
},
EnvironmentEnter {
name: &'src str,
span: SourceSpan,
},
EnvironmentExit {
name: &'src str,
span: SourceSpan,
},
TextModeEnter {
span: SourceSpan,
},
TextModeExit {
span: SourceSpan,
},
}Expand description
One event from a left-to-right walk of math-body source.
Spans are byte ranges into the source slice passed to inspect_math_body.
Command and environment names are returned without the leading backslash.
Variants§
Command
A \name use that is not \begin, \end, or a recognised text-mode
command. The span covers the backslash and the command name.
Fields
span: SourceSpanByte range covering the command token in the source.
EnvironmentEnter
A \begin{name} opener. The span covers \begin and the brace group.
Fields
span: SourceSpanByte range from \begin through the closing brace.
EnvironmentExit
A matched \end{name} closer. The span covers \end and the brace group.
Fields
span: SourceSpanByte range from \end through the closing brace.
TextModeEnter
Entry into a text-mode region (\text{...} and friends). The span covers
the opening brace only.
Fields
span: SourceSpanByte range of the opening brace.
TextModeExit
Exit from a text-mode region. The span covers the closing brace only.
Fields
span: SourceSpanByte range of the closing brace.
Trait Implementations§
Source§impl<'src> Clone for CommandEvent<'src>
impl<'src> Clone for CommandEvent<'src>
Source§fn clone(&self) -> CommandEvent<'src>
fn clone(&self) -> CommandEvent<'src>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'src> Debug for CommandEvent<'src>
impl<'src> Debug for CommandEvent<'src>
Source§impl<'src> PartialEq for CommandEvent<'src>
impl<'src> PartialEq for CommandEvent<'src>
Source§fn eq(&self, other: &CommandEvent<'src>) -> bool
fn eq(&self, other: &CommandEvent<'src>) -> bool
self and other values to be equal, and is used by ==.