pub struct LayoutEngine { /* private fields */ }Expand description
Deterministic layout engine that emits render pages.
Implementations§
Source§impl LayoutEngine
impl LayoutEngine
Sourcepub fn new(cfg: LayoutConfig) -> Self
pub fn new(cfg: LayoutConfig) -> Self
Create a layout engine.
Sourcepub fn with_text_measurer(self, measurer: Arc<dyn TextMeasurer>) -> Self
pub fn with_text_measurer(self, measurer: Arc<dyn TextMeasurer>) -> Self
Install a shared text measurer for glyph-accurate width fitting.
Sourcepub fn layout_items<I>(&self, items: I) -> Vec<RenderPage>where
I: IntoIterator<Item = StyledEventOrRun>,
pub fn layout_items<I>(&self, items: I) -> Vec<RenderPage>where
I: IntoIterator<Item = StyledEventOrRun>,
Layout styled items into pages.
Sourcepub fn start_session(&self) -> LayoutSession
pub fn start_session(&self) -> LayoutSession
Start an incremental layout session.
Sourcepub fn start_session_with_text_measurer(
&self,
measurer: Option<Arc<dyn TextMeasurer>>,
) -> LayoutSession
pub fn start_session_with_text_measurer( &self, measurer: Option<Arc<dyn TextMeasurer>>, ) -> LayoutSession
Start an incremental layout session with an explicit text measurer override.
Sourcepub fn layout_with<I, F>(&self, items: I, on_page: F)
pub fn layout_with<I, F>(&self, items: I, on_page: F)
Layout styled items and stream each page.
Trait Implementations§
Source§impl Clone for LayoutEngine
impl Clone for LayoutEngine
Source§fn clone(&self) -> LayoutEngine
fn clone(&self) -> LayoutEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LayoutEngine
impl !RefUnwindSafe for LayoutEngine
impl Send for LayoutEngine
impl Sync for LayoutEngine
impl Unpin for LayoutEngine
impl UnsafeUnpin for LayoutEngine
impl !UnwindSafe for LayoutEngine
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