Skip to main content

StandInLoadGuard

Struct StandInLoadGuard 

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

RAII guard: while a binding that stands in for an author’s file loads (binding::content::input_definitions), every name assigned is recorded as that binding’s (state::State::stand_in_meanings), whatever made it — its DefMacro!s, its Let!s and RawTeX, the bindings it requires — so the paper’s copy read after it only provides them (state::note_copy_provides_assignment). The names its own code assigns, not a file it loads (StandInLoadGuard::suspend: OmniBus, natbib, a nested stand-in’s own), are also its command set (state::State::stand_in_last_load), which the copy must define to be the file the binding stands in for (binding::content copy_is_the_stood_in_file).

Implementations§

Source§

impl StandInLoadGuard

Source

pub fn new() -> Self

A stand-in binding the code running now requests (binding::content::input’s .tex route): it joins the command set of a stand-in binding loading it when that is the binding’s own code.

Source

pub fn loaded_by(from_own_code: bool) -> Self

A stand-in binding loads, requested by a stand-in binding’s own code when from_own_code (binding::content::input_definitions, stand_in_loader_own_code): its names join that binding’s command set at its end (state::end_stand_in_load) — the diagrams binding’s diagrams.tex (hep-ph9609379) —, and not when a file the outer binding loads requested it: OmniBus’s RequirePackage!("aas_macros") (omnibus_cls.rs:71) under asme2ej (2309.12017), nature-pre (2102.01782, 2111.09589), cimart (2412.00032).

Source

pub fn suspend() -> Self

A file a stand-in binding loads (binding::content::input_definitions): its names are the binding’s to own, but not the binding’s command set, until the guard drops.

Source

pub fn suspend_for(class: bool) -> Self

StandInLoadGuard::suspend for a file that is a class (class, a .cls) or not: a class the binding’s own code loads is its base class (stand_in_base_class), and so is every class that class loads; a package any of them loads is not (the bindings a binding requires stay its own).

Trait Implementations§

Source§

impl Default for StandInLoadGuard

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for StandInLoadGuard

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> 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, 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.