pub enum TextOverflow {
Clip,
Ellipsis,
}Expand description
How text that overflows a bounded [TextContext::layout_bounded]
(max_lines) is handled.
Mirrors Flutter’s TextOverflow.clip/TextOverflow.ellipsis shape (a
deliberately small subset — no fade/visible). Only meaningful
alongside max_lines: with no line cap, neither variant changes
anything (there is nothing to overflow past).
Variants§
Clip
Drop whole lines past max_lines outright; the last visible line’s
own text is left exactly as the line-breaker assigned it, even if it
is itself wider than the box (an unbreakable run with no wrap
opportunity) — Frust does not character-trim in this mode. Default,
and a no-op when max_lines is unset (today’s behavior).
Ellipsis
Same line-dropping as Self::Clip, plus: the last visible line is
character-truncated (UTF-8/char-boundary safe) and has '…'
appended so it fits the layout’s max_width. With an unbounded
max_width, there is no width to truncate against, so the last
visible line’s full text is kept with '…' simply appended.
Trait Implementations§
Source§impl Clone for TextOverflow
impl Clone for TextOverflow
Source§fn clone(&self) -> TextOverflow
fn clone(&self) -> TextOverflow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TextOverflow
Source§impl Debug for TextOverflow
impl Debug for TextOverflow
Source§impl Default for TextOverflow
impl Default for TextOverflow
Source§fn default() -> TextOverflow
fn default() -> TextOverflow
impl Eq for TextOverflow
Source§impl Hash for TextOverflow
impl Hash for TextOverflow
Source§impl PartialEq for TextOverflow
impl PartialEq for TextOverflow
impl StructuralPartialEq for TextOverflow
Auto Trait Implementations§
impl Freeze for TextOverflow
impl RefUnwindSafe for TextOverflow
impl Send for TextOverflow
impl Sync for TextOverflow
impl Unpin for TextOverflow
impl UnsafeUnpin for TextOverflow
impl UnwindSafe for TextOverflow
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.