Skip to main content

Fitable

Trait Fitable 

Source
pub trait Fitable<T: Truncateable>: HasWidth {
    // Required method
    fn truncate(&self, width: usize) -> Option<T>;
}
Expand description

Widgets that can be truncated to fit in a provided width.

Required Methods§

Source

fn truncate(&self, width: usize) -> Option<T>

Truncate self to fit in a given width.

Trait Implementations§

Source§

impl<'a, T: Truncateable> FromIterator<Box<dyn Fitable<T> + 'a>> for HBox<'a, T>

Source§

fn from_iter<I>(iter: I) -> HBox<'a, T>
where I: IntoIterator<Item = Box<dyn Fitable<T> + 'a>>,

Creates a value from an iterator. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T, U> Fitable<<T as WidthSliceable>::Output> for TextWidget<'a, T, U>