Skip to main content

DigestedData

Enum DigestedData 

Source
pub enum DigestedData {
    TBox(RefCell<Tbox>),
    Whatsit(RefCell<Whatsit>),
    Alignment(Box<RefCell<Alignment>>),
    List(RefCell<List>),
    Postponed(Tokens),
    KeyVals(Box<KeyVals>),
    RegisterValue(RegisterValue),
    Comment(Comment),
}
Expand description

These are all kinds of data which we consider officially supported as outputs from the digestion phase of TeX, i.e. from invoking a token.

Variants§

§

TBox(RefCell<Tbox>)

A TeX Box

§

Whatsit(RefCell<Whatsit>)

A TeX Whatsit (with interior mutability, for setters invoked while stored in state)

§

Alignment(Box<RefCell<Alignment>>)

A TeX Alignment (with interior mutability, for setters invoked while stored in state)

§

List(RefCell<List>)

A list of Digested data

§

Postponed(Tokens)

Raw Tokens that were postponed to the digestion phase uninvoked/undigested

§

KeyVals(Box<KeyVals>)

A LaTeX-like digested key-value map.

Boxed to keep it off the hot DigestedData size budget: KeyVals is a heavy struct (two Strings, three Vecs, two HashMaps ≈ 208 B) but a rare variant, whereas DigestedData is Rc-allocated once per box and every box in a document pays its size. Inlining KeyVals made the whole enum 208 B; boxing it took 40 B off every digested box (issue #361 memory pass, M2), and the added indirection only touches the rare KeyVals accesses. Measured at 0.83 % of live boxes on the #361 witness — the rarity is what makes the trade pay.

§

RegisterValue(RegisterValue)

A TeX-like RegisterValue (e.g. a Dimension or Glue)

§

Comment(Comment)

A TeX comment

Trait Implementations§

Source§

impl Debug for DigestedData

Source§

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

Formats the value using the given formatter. 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 = 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.