Trait Metrics

Source
pub trait Metrics {
    // Required methods
    fn char_width(&self, c: char) -> usize;
    fn tab_stop(&self) -> usize;
}
Expand description

Gives the size of each character and tab stop length.

This is used to correctly compute spans in the source text, and render the text using a Formatter.

Required Methods§

Source

fn char_width(&self, c: char) -> usize

Get the size (width in columns) of a character.

Source

fn tab_stop(&self) -> usize

Get the tab stop length.

Implementors§