Skip to main content

Content

Trait Content 

Source
pub trait Content: Any {
    // Required method
    fn to_string(&self, theme: &Theme) -> String;
}
Expand description

A value that can be displayed as content in a tree node.

This trait is implemented for all types that can appear as leaf content or labels in a tree. It provides a way to convert a value to a colored string representation.

Required Methods§

Source

fn to_string(&self, theme: &Theme) -> String

Trait Implementations§

Source§

impl Content for Box<dyn Content>

Source§

fn to_string(&self, theme: &Theme) -> String

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Content for Box<dyn Content>

Source§

fn to_string(&self, theme: &Theme) -> String

Implementors§

Source§

impl Content for Index

Source§

impl Content for Keyword

Source§

impl Content for Member

Source§

impl Content for TypeName

Source§

impl<T: Debug + Any> Content for T

Blanket implementation of Content for any Debug + Any type.

This provides automatic content conversion for most Rust types:

  • Strings and &str are displayed with string coloring
  • All other types are displayed with value coloring