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§
Sourcefn format_hash(hash: String) -> String
fn format_hash(hash: String) -> String
Formats the given checksum string.
Sourcefn get_line(&self) -> &FormattableLine
fn get_line(&self) -> &FormattableLine
Retrieves the underlying FormattableLine object.
Provided Methods§
Sourcefn coloursum<I: BufRead, O: Write>(from: I, to: O) -> Result<()>
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.
Sourcefn to_formatted(&self, formatter: &mut Formatter<'_>) -> Result
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.