Skip to main content

DefinitionOrigin

Enum DefinitionOrigin 

Source
pub enum DefinitionOrigin {
    Unknown,
    Plain,
    LatexDump,
    Pool,
    Binding,
    Fallback,
    Stub,
    Borrowed,
    Format,
    File,
    Document,
}
Expand description

Who made a definition.

Variants§

§

Unknown

Made before any loader seam set an origin (engine bootstrap) — ours.

§

Plain

The PLAIN layer: restored from the plain format dump (embedded or a plain.YYYY.dump.txt on disk), or made by a plain pool (plain_*). Perl tells the same layer by its definitions’ source (isDefinableLaTeX, latex_constructs.pool.ltxml:2512-2517: getShortSource =~ /^plain/): LaTeX’s \newcommand/\@ifdefinable may redefine what plain defined.

§

LatexDump

Restored from the LaTeX format dump (<embedded:latex>).

§

Pool

A Rust pool (InnerPool!/LoadPool!: TeX.pool, LaTeX.pool, constructs).

§

Binding

A compiled binding’s own code (DefMacro!/RawTeX! in a *_sty.rs).

§

Fallback

The guess of a fallback class — OmniBus, loaded for a class with no binding: what it defines is a convenience the real class may not have, so a document’s own \newcommand (and \providecommand, \newenvironment, \@ifdefinable) of the name wins over it, unless it is locked (state::is_fallback_meaning) — and as OmniBus’s fallback, locked too (state::document_redefines_guess).

§

Stub

A kernel stand-in for a name a class or style defines only where the document cannot reach it (aaai’s \equalcontrib, set inside its \@maketitle): yields as Fallback does, and to a raw class’s or package’s own \newcommand of the name too, since the real file does define it (copernicus.cls:1673 \equalcontrib[1]).

§

Borrowed

What a binding borrows from a package the real one does not load (binding::content::require_package_borrowed: theorem.sty’s and ntheorem.sty’s bindings borrow amsthm’s): in LaTeX the names do not exist, so they yield as Fallback does, and to every raw file’s own definition too — TeX Live’s or the author’s (cc.cls’s ccproof.sty:56 \newenvironment{proof} after theorem.sty; 1507.02955).

§

Format

A raw format file read as definitions (latex.ltx, plain.tex, expl3-code.tex).

§

File

A raw .sty/.cls/.def/.tex the document loaded as definitions.

§

Document

The document’s own preamble or body.

Implementations§

Source§

impl DefinitionOrigin

Source

pub fn is_latexml_owned(self) -> bool

Is this definition LaTeXML’s own — a pool, dump, binding or format layer — rather than the document’s? The l3/ltcmd declarators tolerate redefinition of our own pre-definitions (the class-level names real LaTeX keeps in article.cls) and report genuine double declarations.

Source

pub fn is_binding_made(self) -> bool

Is this definition a binding’s — its own code, a fallback class’s guess, a stand-in, a borrowing — rather than the kernel’s (a pool, a dump, a format) or the document’s (state::note_dropped_argument)?

Trait Implementations§

Source§

impl Clone for DefinitionOrigin

Source§

fn clone(&self) -> Self

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 Copy for DefinitionOrigin

Source§

impl Debug for DefinitionOrigin

Source§

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

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

impl Eq for DefinitionOrigin

Source§

impl PartialEq for DefinitionOrigin

Source§

fn eq(&self, other: &Self) -> 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 DefinitionOrigin

Auto Trait Implementations§

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.