Struct termimad::FmtComposite [−][src]
pub struct FmtComposite<'s> { pub composite: Composite<'s>, pub visible_length: usize, pub spacing: Option<Spacing>, }
Expand description
Wrap a Minimad Composite, which is a list of Compounds (which are strings with an homogeneous style)
Fields
composite: Composite<'s>
visible_length: usize
spacing: Option<Spacing>
Implementations
Return the number of characters (usually spaces) to insert both sides of the composite
Add a compound and modifies visible_length
accordingly
Ensure the cached visible_length is correct.
It’s normally not necessary to call it, but this must be called if compounds are added, removed or modified without using the FmtComposite API
try to ensure the composite’s width doesn’t exceed the given width.
The alignment can be used, if necessary, to know which side it’s better to remove content (for example if the alignment is left then we remove at right). The fitter may remove a part in the core of the composite if it looks good enough. In this specific case an ellipsis will replace the removed part.
if the composite is smaller than the given width, pad it according to the alignment.
try to make it so that the composite has exactly the given width, either by shortening it or by adding space.
This calls the fit_width
and extend_width
methods.
Trait Implementations
Auto Trait Implementations
impl<'s> RefUnwindSafe for FmtComposite<'s>
impl<'s> Send for FmtComposite<'s>
impl<'s> Sync for FmtComposite<'s>
impl<'s> Unpin for FmtComposite<'s>
impl<'s> UnwindSafe for FmtComposite<'s>
Blanket Implementations
Mutably borrows from an owned value. Read more