Skip to main content

CrossRefs

Struct CrossRefs 

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

Port of crossRef.ml’s mutable cross-reference table.

Implementations§

Source§

impl CrossRefs

Source

pub fn new() -> CrossRefs

Source

pub fn seeded(table: AuxTable) -> CrossRefs

A table pre-populated from a previous run’s auxiliary file.

Seeding only changes how fast the fixpoint converges, never where it converges to: a seeded value a get observes and a later register contradicts still marks the layout stale and forces another trial. It mainly helps a forward reference (\ref to a later section) resolve on trial 1 instead of trial 2.

Source

pub fn export(&self) -> AuxTable

The table as it should be written back out.

Keys this run neither read nor registered are carried through verbatim, so an auxiliary file round-trips with upstream SATySFi.

Source

pub fn seed_unvalidated(&self) -> bool

Did the trial that just ended READ a seeded value that it never re-registered?

If so the layout depended on a value from a previous run that was never re-derived this run (e.g. a \label the document dropped but some \ref still targets) — unverifiable, not necessarily wrong. The driver’s answer is to discard the seed and redo the fixpoint cold, so a warm build is always byte-identical to a cold one.

Source

pub fn register(&mut self, k: String, v: String)

crossRef.ml:99, plus the fixpoint-shortcut bookkeeping: if this key was already READ this trial and the value the reader saw differs from v, the layout is now stale and another trial is required. A key that is (re)registered but never read this trial does NOT force a retrial — its value cannot have affected the output — which is what lets a document that only writes cross-references (e.g. page labels nothing \refs) converge in ONE trial.

Source

pub fn get(&mut self, k: &str) -> Option<String>

crossRef.ml:116 — records a miss (an unresolved forward reference) alongside the ordinary lookup, and remembers what the reader observed so a later register can tell whether that observation went stale.

Source

pub fn probe(&self, k: &str) -> Option<String>

crossRef.ml:112 — like Self::get but records no miss (probe-cross-reference): probing an absent key must NOT force another fixpoint trial.

Source

pub fn verdict(&mut self) -> Verdict

crossRef.ml:78 needs_another_trial, tightened: retry only if a value the layout READ this trial was invalidated (stale), not on every (re)registration. Consumes this trial’s bookkeeping and resets it.

Trait Implementations§

Source§

impl Debug for CrossRefs

Source§

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

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

impl Default for CrossRefs

Source§

fn default() -> CrossRefs

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Debug for T
where T: Debug,

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V