pub enum FormatStyle {
Display,
Debug,
}Expand description
Which of the two renderings a format callback is producing.
Exactly one type reads this — Text — and it is one bit rather than a second
callback per descriptor because of nesting: a Vec[Text] renders its
elements through the element descriptor’s format, so whatever distinguishes
the two renderings has to travel down that recursion. A format_debug field
beside format would not: vec_format would have to know which of the two
it was itself running as in order to pick the right one for its elements, and
that knowledge is exactly this enum.
Variants§
Display
The program’s own rendering: out(v), "{v}" interpolation, to_text()
and praxis run’s result line. A Text is its characters, because that
is what a program printing a string means (§16.1, and §8.1 for the
interpolation that shares the callback).
Debug
The debugger’s rendering: a locals row, a TUI pane cell, p EXPR. A
Text is a quoted literal here, because a display that gives each value
one line and no other context cannot afford a value that renders as zero
characters, as a newline, or as something an adjacent " could have
ended.
Trait Implementations§
Source§impl Clone for FormatStyle
impl Clone for FormatStyle
Source§fn clone(&self) -> FormatStyle
fn clone(&self) -> FormatStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more