pub struct DocumentValue {
pub geometry: PageGeometry,
pub pages: Vec<Page>,
pub images: Vec<ImageResource>,
pub extras: DocExtras,
pub reflow_source: Option<Vec<VertBox>>,
pub reflow_links: Vec<(DecoId, AnnotAction)>,
pub reflow_dests: Vec<(DecoId, String)>,
pub reflow_frame_decos: Vec<(DecoId, FrameDecoration)>,
}Expand description
The final result of evaluating a document.
Fields§
§geometry: PageGeometry§pages: Vec<Page>§images: Vec<ImageResource>Every image load-image decoded while evaluating this document,
indexed by ImageId (PureHorzBox::Image::image / Value::Image
point in here). Moved out of eval::Interp::images by page-break
when it packages the final document; threaded to
rustyfi_pdf::render_pdf/render_pdf_ttf so the PDF writer can emit
one Image XObject per image actually used.
extras: DocExtrasExtras (annotations / destinations / outline / per-page deco
overlays), attached by the compile driver AFTER the final trial’s
fire_hooks — prim_page_break cannot fill this (hooks/decos fire
only after placement), so it packages DocExtras::default() and
compile_document_cst_with_trials overwrites it on the winning trial.
reflow_source: Option<Vec<VertBox>>Reflowable/semantic HTML side-channel: a clone of the
flat Vec<VertBox> as it existed just BEFORE page_break_core
handed it to chop_page — the document’s natural linear flow, with
paragraph boundaries (Skip), frame nesting (FrameStart/FrameEnd
marker pairs), and ClearPage all intact, not yet sliced into pages
or carrying injected headers/footers/footnotes. Populated
unconditionally (one negligible Vec<VertBox> clone per compile,
rather than threading a want_reflow flag through every entry
point). Option keeps the field’s meaning (“present only for a
reflow-capable compile”) self-documenting even though every current
producer fills it.
Purely additive. Neither rustyfi_pdf::render_pdf* nor the
html-support branch’s faithful HTML backend reads this field —
only that branch’s REFLOWABLE backend does.
reflow_links: Vec<(DecoId, AnnotAction)>Links: one (DecoId, action) per register-link-to-uri/
-to-location call made from inside a firing deco closure — needed
because (unlike extras.annotations, which is page-absolute with no
DecoId) this is what lets the reflow backend find which
PureHorzBox::Frame in reflow_source a link belongs to.
NOTE for whoever merges html-support: \href/\ref go through
inline-frame-breakable, which no longer builds a Frame at all —
it splices its contents between a PureHorzBox::InlineFrameMarker
pair — so the reflow walker has to match the MARKER’s DecoId (and
wrap the boxes between the pair) rather than a Frame’s, or every
link silently stops being wrapped. Filled in by eval_document_trials
AFTER fire_hooks. Empty by default, same “purely additive” policy
as reflow_source.
reflow_dests: Vec<(DecoId, String)>Same idea as reflow_links, for register-destination
(annot.satyh’s register-location-frame idiom): (DecoId, name).
reflow_frame_decos: Vec<(DecoId, FrameDecoration)>Each block frame’s own decoration at its natural size, box-local
(FrameDecoration). Same provenance and lifetime as reflow_dests:
filled by fire_hooks, drained by eval_document_trials, read only
by the reflowable HTML backend — which has no page grid and so cannot
re-run a deco callback itself.
Trait Implementations§
Source§impl Clone for DocumentValue
impl Clone for DocumentValue
Source§fn clone(&self) -> DocumentValue
fn clone(&self) -> DocumentValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DocumentValue
impl RefUnwindSafe for DocumentValue
impl Send for DocumentValue
impl Sync for DocumentValue
impl Unpin for DocumentValue
impl UnsafeUnpin for DocumentValue
impl UnwindSafe for DocumentValue
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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