Trait ToTldr

Source
pub trait ToTldr<T = String> {
    type Error;

    // Required method
    fn to_tldr(&self) -> Box<dyn Tldr<T, Error = Self::Error>>;
}
Expand description

A trait for converting objects into TL;DR summaries.

§Examples

struct Rectangle {
    width: u32,
    height: u32,
}

impl ToTldr<String> for Rectangle {
    type Error = Box<dyn core::error::Error>;

    fn to_tldr(&self) -> Box<dyn Tldr<String, Error = Self::Error>> {
        todo!() // FIXME
    }
}

Required Associated Types§

Source

type Error

The associated error type.

If in doubt, specify this as Box<dyn Error>.

Required Methods§

Source

fn to_tldr(&self) -> Box<dyn Tldr<T, Error = Self::Error>>

Implementors§

Source§

impl<T: Clone + Debug + Default + 'static> ToTldr<T> for TldrSummary<T>