Trait StringRep

Source
pub trait StringRep {
    // Required methods
    fn str_rep(&self) -> &'static str;
    fn string_rep(&self) -> String;
}
Expand description

A simple trait for allowing the use of representing something as a string in an easy and extendible way.

Required Methods§

Source

fn str_rep(&self) -> &'static str

Basic &str representation of the generic implamented trait.

Source

fn string_rep(&self) -> String

Customised representation addressing the individual part of the implamented trait. If there is none, it is allowed to fall back to StringRep::str_rep.

Implementors§