pub struct BreakerState { /* private fields */ }Expand description
The mutable state of the line breaker.
This is exposed so that callers using BreakLines directly can inspect and
adjust line geometry between calls to BreakLines::break_next.
A BreakerState can be cloned and later passed to BreakLines::revert_to
to retry layout from a saved checkpoint.
Implementations§
Source§impl BreakerState
impl BreakerState
Sourcepub fn append_cluster_to_line(&mut self, next_x: f32, clusters_height: f32)
pub fn append_cluster_to_line(&mut self, next_x: f32, clusters_height: f32)
Add the cluster(s) currently being evaluated to the current line
Sourcepub fn append_inline_box_to_line(&mut self, next_x: f32, box_height: f32)
pub fn append_inline_box_to_line(&mut self, next_x: f32, box_height: f32)
Add inline box to line
Sourcepub fn layout_max_advance(&self) -> f32
pub fn layout_max_advance(&self) -> f32
Get the max-advance of the entire layout
Sourcepub fn set_layout_max_advance(&mut self, advance: f32)
pub fn set_layout_max_advance(&mut self, advance: f32)
Set the max-advance of the entire layout
Sourcepub fn line_max_advance(&self) -> f32
pub fn line_max_advance(&self) -> f32
Get the max-advance of the current line
Sourcepub fn set_line_max_advance(&mut self, advance: f32)
pub fn set_line_max_advance(&mut self, advance: f32)
Set the max-advance of the current line
Sourcepub fn line_max_height(&self) -> f32
pub fn line_max_height(&self) -> f32
Get the max-height of the current line
Sourcepub fn set_line_max_height(&mut self, height: f32)
pub fn set_line_max_height(&mut self, height: f32)
Set the max-height of the current line.
Sourcepub fn set_line_x(&mut self, x: f32)
pub fn set_line_x(&mut self, x: f32)
Set the x-offset for the current line.
Sourcepub fn set_line_y(&mut self, y: f64)
pub fn set_line_y(&mut self, y: f64)
Set the y-offset for the current line.
Trait Implementations§
Source§impl Clone for BreakerState
impl Clone for BreakerState
Source§fn clone(&self) -> BreakerState
fn clone(&self) -> BreakerState
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 BreakerState
impl RefUnwindSafe for BreakerState
impl Send for BreakerState
impl Sync for BreakerState
impl Unpin for BreakerState
impl UnsafeUnpin for BreakerState
impl UnwindSafe for BreakerState
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