Skip to main content

Begin

Struct Begin 

Source
pub struct Begin { /* private fields */ }
Expand description

A \begin{name} node.

Implementations§

Source§

impl Begin

Source

pub fn name_group(&self) -> Option<NameGroup>

The {name} group following \begin.

Source

pub fn name(&self) -> Option<String>

The environment name (braces dropped), or None for a malformed \begin.

A BEGIN opened by an environment alias (\bea, issue #109) carries no NAME_GROUP at all — the whole node is the bare control word — so the name falls back to that word with its \ stripped. Positional and meaning-free, per decision #10: it reads the name from wherever the tree puts it and looks nothing up. Signatures::environment is what maps bea on to the target’s curated behavior.

The fallback is guarded on the head not being \begin, so the malformed \begin-without-a-name path (which builds a BEGIN with no NAME_GROUP) keeps reporting None rather than suddenly claiming to be named begin.

Source

pub fn is_alias(&self) -> bool

Whether this BEGIN is an environment-alias delimiter — a bare control word standing in for \begin{X} — rather than a spelled-out \begin{X}.

Purely structural (no NAME_GROUP, head is not \begin), like every other accessor here. It exists because name makes the two shapes indistinguishable by name, and the alias table describes the command, not the name: a literal \begin{bea} written in a file that also defines \bea as an alias is a different, unrelated environment and must not inherit the target’s behavior. Signatures::environment_at is the consumer.

Source

pub fn name_range(&self) -> Option<TextRange>

The byte range of the environment name inside the NAME_GROUP.

Trait Implementations§

Source§

impl AstNode for Begin

Source§

impl Clone for Begin

Source§

fn clone(&self) -> Begin

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 Debug for Begin

Source§

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

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

impl Eq for Begin

Source§

impl Hash for Begin

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Begin

Source§

fn eq(&self, other: &Begin) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Begin

Auto Trait Implementations§

§

impl !RefUnwindSafe for Begin

§

impl !Send for Begin

§

impl !Sync for Begin

§

impl !UnwindSafe for Begin

§

impl Freeze for Begin

§

impl Unpin for Begin

§

impl UnsafeUnpin for Begin

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.