Skip to main content

DocumentValue

Struct DocumentValue 

Source
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: DocExtras

Extras (annotations / destinations / outline / per-page deco overlays), attached by the compile driver AFTER the final trial’s fire_hooksprim_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

Source§

fn clone(&self) -> DocumentValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DocumentValue

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<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> Clone for T
where T: Clone,

Source§

fn clone(&self) -> T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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