pub struct LayoutCtx<'a> {
pub resolver: &'a dyn FontResolver,
pub toc_headings: &'a [TocHeading],
pub toc_heading_pages: Option<&'a HashMap<String, usize>>,
}Fields§
§resolver: &'a dyn FontResolver§toc_headings: &'a [TocHeading]Every heading (Text::outline_level) in the whole document, in
document order — independent of pagination (issue #10’s
TableOfContents), so identical in both layout passes.
toc_heading_pages: Option<&'a HashMap<String, usize>>None during pass 1 (page numbers aren’t known yet — a
TableOfContents renders its entries without one). Some during
pass 2, keyed by each heading’s TocHeading::anchor, filled in
from pass 1’s own result — the same “pass 1 informs pass 2”
mechanism PageContext.total_pages uses for Header/Footer.
Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LayoutCtx<'a>
impl<'a> !Send for LayoutCtx<'a>
impl<'a> !Sync for LayoutCtx<'a>
impl<'a> !UnwindSafe for LayoutCtx<'a>
impl<'a> Freeze for LayoutCtx<'a>
impl<'a> Unpin for LayoutCtx<'a>
impl<'a> UnsafeUnpin for LayoutCtx<'a>
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
Mutably borrows from an owned value. Read more