Line

Trait Line 

Source
pub trait Line: Display + From<String> {
    // Required methods
    fn format_hash(hash: String) -> String;
    fn get_line(&self) -> &FormattableLine;

    // Provided methods
    fn coloursum<I: BufRead, O: Write>(from: I, to: O) -> Result<()> { ... }
    fn to_formatted(&self, formatter: &mut Formatter<'_>) -> Result { ... }
}
Expand description

Used to present a formattable line, which can be derived from a String.

Required Methods§

Source

fn format_hash(hash: String) -> String

Formats the given checksum string.

Source

fn get_line(&self) -> &FormattableLine

Retrieves the underlying FormattableLine object.

Provided Methods§

Source

fn coloursum<I: BufRead, O: Write>(from: I, to: O) -> Result<()>

Takes each line in from, and writes it to to.

If a given line is recognisable as the output of a hashing utility, its hash value will be coloured.

Source

fn to_formatted(&self, formatter: &mut Formatter<'_>) -> Result

Writes the processed line to the supplied Formatter.

May be overridden in order to replace the checksum-replacing behaviour if necessary.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§