pub trait Printing<T>: Sized {
// Required methods
fn to_str(self) -> String;
fn to_plainstr(self) -> String;
// Provided methods
fn rd(self) -> String { ... }
fn gr(self) -> String { ... }
fn bl(self) -> String { ... }
fn yl(self) -> String { ... }
fn mg(self) -> String { ... }
fn cy(self) -> String { ... }
fn wvec(self, f: &mut File) -> Result<(), Error> { ... }
fn pvec(self) { ... }
}
Expand description
Trait to serialize tuples &(T,T)
and &(T,T,T)
and
slices &[T]
, &[&[T]]
, &[Vec<T>]
.
Suitable for printing or writing to files pairs, triplets,
all kinds of Vecs and slices and irregularly shaped 2D matrices.
All are converted into Strings and optionally decorated and coloured.
Included are methods and constants to render the resulting String
in six primary bold ANSI terminal colours.
Required Methods§
sourcefn to_str(self) -> String
fn to_str(self) -> String
Method to serialize.
Decorates Vecs with square brackets and tuples with round ones.
Implementation code is in printing.rs
.
sourcefn to_plainstr(self) -> String
fn to_plainstr(self) -> String
Method to serialize in minimal form (space separated, no brackets)
Implementation code is in printing.rs
.
Provided Methods§
Object Safety§
This trait is not object safe.