pub struct BreakPenalty {
pub value: i64,
pub flagged: bool,
}Expand description
Penalty value for a break point.
Penalties influence where breaks occur:
- Negative penalty attracts breaks (e.g. after punctuation).
- Positive penalty repels breaks (e.g. avoid breaking before “I”).
PENALTY_FORBIDDEN(i64::MAX) makes the break infeasible.
Fields§
§value: i64The penalty value. Higher = less desirable break.
flagged: boolWhether this is a flagged break (e.g. hyphenation).
Two consecutive flagged breaks incur double_hyphen_demerit.
Implementations§
Source§impl BreakPenalty
impl BreakPenalty
Trait Implementations§
Source§impl Clone for BreakPenalty
impl Clone for BreakPenalty
Source§fn clone(&self) -> BreakPenalty
fn clone(&self) -> BreakPenalty
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 moreSource§impl Debug for BreakPenalty
impl Debug for BreakPenalty
Source§impl PartialEq for BreakPenalty
impl PartialEq for BreakPenalty
impl Copy for BreakPenalty
impl Eq for BreakPenalty
impl StructuralPartialEq for BreakPenalty
Auto Trait Implementations§
impl Freeze for BreakPenalty
impl RefUnwindSafe for BreakPenalty
impl Send for BreakPenalty
impl Sync for BreakPenalty
impl Unpin for BreakPenalty
impl UnsafeUnpin for BreakPenalty
impl UnwindSafe for BreakPenalty
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.