Skip to main content

CommandEvent

Enum CommandEvent 

Source
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

§name: &'src str

Command name without the leading backslash.

§span: SourceSpan

Byte range covering the command token in the source.

§

EnvironmentEnter

A \begin{name} opener. The span covers \begin and the brace group.

Fields

§name: &'src str

Environment name as written inside the braces.

§span: SourceSpan

Byte range from \begin through the closing brace.

§

EnvironmentExit

A matched \end{name} closer. The span covers \end and the brace group.

Fields

§name: &'src str

Environment name as written inside the braces.

§span: SourceSpan

Byte 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: SourceSpan

Byte range of the opening brace.

§

TextModeExit

Exit from a text-mode region. The span covers the closing brace only.

Fields

§span: SourceSpan

Byte range of the closing brace.

Trait Implementations§

Source§

impl<'src> Clone for CommandEvent<'src>

Source§

fn clone(&self) -> CommandEvent<'src>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'src> Debug for CommandEvent<'src>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'src> PartialEq for CommandEvent<'src>

Source§

fn eq(&self, other: &CommandEvent<'src>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'src> Copy for CommandEvent<'src>

Source§

impl<'src> Eq for CommandEvent<'src>

Source§

impl<'src> StructuralPartialEq for CommandEvent<'src>

Auto Trait Implementations§

§

impl<'src> Freeze for CommandEvent<'src>

§

impl<'src> RefUnwindSafe for CommandEvent<'src>

§

impl<'src> Send for CommandEvent<'src>

§

impl<'src> Sync for CommandEvent<'src>

§

impl<'src> Unpin for CommandEvent<'src>

§

impl<'src> UnsafeUnpin for CommandEvent<'src>

§

impl<'src> UnwindSafe for CommandEvent<'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.