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(self, fc: &mut FmtComposite<'_>, max_width: usize, skin: &MadSkin)
pub fn fit(self, fc: &mut FmtComposite<'_>, max_width: usize, skin: &MadSkin)
ensure the composite fits the max_width, by replacing some parts with ellisions
Trait Implementations§
impl Copy for Fitter
Auto Trait Implementations§
impl Freeze for Fitter
impl RefUnwindSafe for Fitter
impl Send for Fitter
impl Sync for Fitter
impl Unpin for Fitter
impl UnwindSafe for Fitter
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)