pub fn wrap_end(
s: &str,
pos: usize,
pe: usize,
fits: &mut dyn FnMut(usize, usize) -> bool,
) -> usizeExpand description
where a line starting at pos ends inside pos..pe (pos < end <= pe; pe when pos == pe): the whole rest when it fits, else the last break opportunity whose text before it (without trailing spaces) fits, else grapheme clusters while they fit (at least one); a mandatory break inside ends the line there. fits(a, b): the text a..b fits.