Skip to main content

LineWidthProvider

Trait LineWidthProvider 

Source
pub trait LineWidthProvider {
    // Required methods
    fn line_count(&self) -> usize;
    fn width(&self, line: usize) -> Option<usize>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Supplies the available inline extent for each laid-out line.

Layout never requests a width beyond crate::TextFlow::with_max_lines.

Required Methods§

Source

fn line_count(&self) -> usize

Source

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

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl LineWidthProvider for [usize]

Source§

fn line_count(&self) -> usize

Source§

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

Source§

impl<const N: usize> LineWidthProvider for [usize; N]

Source§

fn line_count(&self) -> usize

Source§

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

Implementors§