pub struct Clip<'a> {
pub kept: &'a str,
pub overflowed: bool,
pub total: usize,
}Expand description
The result of clipping text to a byte cap.
Fields§
§kept: &'a strThe kept prefix, never longer than the cap and always char-aligned.
overflowed: boolWhether the text was longer than the cap and had to be trimmed.
total: usizeThe full UTF-8 byte length of the original text.
Trait Implementations§
impl<'a> Eq for Clip<'a>
impl<'a> StructuralPartialEq for Clip<'a>
Auto Trait Implementations§
impl<'a> Freeze for Clip<'a>
impl<'a> RefUnwindSafe for Clip<'a>
impl<'a> Send for Clip<'a>
impl<'a> Sync for Clip<'a>
impl<'a> Unpin for Clip<'a>
impl<'a> UnsafeUnpin for Clip<'a>
impl<'a> UnwindSafe for Clip<'a>
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