#[repr(u8)]pub enum FitnessClass {
Tight = 0,
Normal = 1,
Loose = 2,
VeryLoose = 3,
}Expand description
Fitness class for a line based on its adjustment ratio.
The adjustment ratio r = slack / stretch (or slack / shrink for
negative slack) determines how much a line differs from its natural width.
Variants§
Tight = 0
r < -0.5 (compressed line).
Normal = 1
-0.5 ≤ r < 0.5 (well-set line).
Loose = 2
0.5 ≤ r < 1.0 (somewhat loose line).
VeryLoose = 3
r ≥ 1.0 (very loose line).
Implementations§
Source§impl FitnessClass
impl FitnessClass
Sourcepub fn from_ratio(ratio: f64) -> Self
pub fn from_ratio(ratio: f64) -> Self
Classify a line’s fitness from its adjustment ratio.
The ratio is slack / width for positive slack (stretch)
or slack / width for negative slack (shrink).
Sourcepub const fn incompatible(self, other: Self) -> bool
pub const fn incompatible(self, other: Self) -> bool
Whether two consecutive fitness classes are incompatible (differ by more than one level), warranting a fitness demerit.
Trait Implementations§
Source§impl Clone for FitnessClass
impl Clone for FitnessClass
Source§fn clone(&self) -> FitnessClass
fn clone(&self) -> FitnessClass
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 FitnessClass
impl Debug for FitnessClass
Source§impl Hash for FitnessClass
impl Hash for FitnessClass
Source§impl Ord for FitnessClass
impl Ord for FitnessClass
Source§fn cmp(&self, other: &FitnessClass) -> Ordering
fn cmp(&self, other: &FitnessClass) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FitnessClass
impl PartialEq for FitnessClass
Source§impl PartialOrd for FitnessClass
impl PartialOrd for FitnessClass
impl Copy for FitnessClass
impl Eq for FitnessClass
impl StructuralPartialEq for FitnessClass
Auto Trait Implementations§
impl Freeze for FitnessClass
impl RefUnwindSafe for FitnessClass
impl Send for FitnessClass
impl Sync for FitnessClass
impl Unpin for FitnessClass
impl UnsafeUnpin for FitnessClass
impl UnwindSafe for FitnessClass
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.