pub enum BreakingStrategy {
Greedy,
KnuthPlass,
}Expand description
Controls which line-breaking algorithm the layout engine uses.
The default is BreakingStrategy::Greedy, which runs in O(n) and matches
the behaviour of browsers’ white-space: normal wrapping.
BreakingStrategy::KnuthPlass minimises total paragraph demerits (see
crate::knuth_plass) and typically produces more even line lengths.
Variants§
Greedy
Greedy (first-fit) algorithm — O(n), default.
KnuthPlass
Knuth-Plass optimal algorithm — minimises total paragraph demerits.
Falls back to greedy when max_width is 0 or no feasible solution
exists.
Trait Implementations§
Source§impl Clone for BreakingStrategy
impl Clone for BreakingStrategy
Source§fn clone(&self) -> BreakingStrategy
fn clone(&self) -> BreakingStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BreakingStrategy
impl Debug for BreakingStrategy
Source§impl Default for BreakingStrategy
impl Default for BreakingStrategy
Source§fn default() -> BreakingStrategy
fn default() -> BreakingStrategy
Returns the “default value” for a type. Read more
Source§impl PartialEq for BreakingStrategy
impl PartialEq for BreakingStrategy
Source§fn eq(&self, other: &BreakingStrategy) -> bool
fn eq(&self, other: &BreakingStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for BreakingStrategy
impl Eq for BreakingStrategy
impl StructuralPartialEq for BreakingStrategy
Auto Trait Implementations§
impl Freeze for BreakingStrategy
impl RefUnwindSafe for BreakingStrategy
impl Send for BreakingStrategy
impl Sync for BreakingStrategy
impl Unpin for BreakingStrategy
impl UnsafeUnpin for BreakingStrategy
impl UnwindSafe for BreakingStrategy
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
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>
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 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>
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