pub struct LineClamp {
pub max_lines: Option<u32>,
pub block_ellipsis: BlockEllipsis,
}Expand description
Lines past a clamp point are discarded, as CSS Overflow 4 line-clamp discards them.
The clamp point is after the last line within max_lines that fits the box’s height, and
never before the first line. Unlike CSS, the height counts without max-lines: auto, so
clamped text stays inside a box that has one. A cut line is shortened to its last word end,
else its last character, at which the ellipsis fits after it. Text animators count no unit
for the ellipsis, which moves with the character before it.
Fields§
§max_lines: Option<u32>Most lines, at least 1, as CSS max-lines. None cuts at the box’s height alone.
block_ellipsis: BlockEllipsisWhat ends the last kept line of cut text. Default ellipsis, as CSS line-clamp sets it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LineClamp
impl<'de> Deserialize<'de> for LineClamp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for LineClamp
Auto Trait Implementations§
impl Forget for LineClamp
impl Freeze for LineClamp
impl Move for LineClamp
impl RefUnwindSafe for LineClamp
impl Send for LineClamp
impl Sync for LineClamp
impl Unpin for LineClamp
impl UnsafeUnpin for LineClamp
impl UnwindSafe for LineClamp
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