Skip to main content

Element

Trait Element 

Source
pub trait Element: Copy {
    // Required methods
    fn default_color(color: Color) -> Self;
    fn strlen(self) -> usize;
    fn append_to_string(self, string: &mut String);
}
Expand description

A renderable character or string fragment used by the plain-text renderer.

Implemented for char and &'static str so a Renderer can be driven with either.

Required Methods§

Source

fn default_color(color: Color) -> Self

Returns the default element for a dark or light module.

Source

fn strlen(self) -> usize

The length (in bytes/chars) of this element when rendered.

Source

fn append_to_string(self, string: &mut String)

Appends this element to string.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Element for &str

Source§

fn default_color(color: Color) -> Self

Source§

fn strlen(self) -> usize

Source§

fn append_to_string(self, string: &mut String)

Source§

impl Element for char

Source§

fn default_color(color: Color) -> Self

Source§

fn strlen(self) -> usize

Source§

fn append_to_string(self, string: &mut String)

Implementors§