pub struct CrossRefs { /* private fields */ }Expand description
Port of crossRef.ml’s mutable cross-reference table.
Implementations§
Source§impl CrossRefs
impl CrossRefs
pub fn new() -> CrossRefs
Sourcepub fn seeded(table: AuxTable) -> CrossRefs
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.
Sourcepub fn export(&self) -> AuxTable
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.
Sourcepub fn seed_unvalidated(&self) -> bool
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.
Sourcepub fn register(&mut self, k: String, v: String)
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.
Sourcepub fn get(&mut self, k: &str) -> Option<String>
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrossRefs
impl RefUnwindSafe for CrossRefs
impl Send for CrossRefs
impl Sync for CrossRefs
impl Unpin for CrossRefs
impl UnsafeUnpin for CrossRefs
impl UnwindSafe for CrossRefs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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