pub struct Fitter { /* private fields */ }
Expand description
A fitter can shorten a composite to make it fit a target width without wrapping (by removing parts and replacing them with ellipsis)
Implementations§
source§impl Fitter
impl Fitter
sourcepub fn for_align(align: Alignment) -> Self
pub fn for_align(align: Alignment) -> Self
create a fitter for when you want a specific alignment.
You may still change the mid_token_ellision and mid_compound_ellision later
sourcepub fn fit<'s>(self, fc: &mut FmtComposite<'s>, max_width: usize, skin: &MadSkin)
pub fn fit<'s>(self, fc: &mut FmtComposite<'s>, max_width: usize, skin: &MadSkin)
ensure the composite fits the max_width, by replacing some parts with ellisions