pub struct Theme {Show 16 fields
pub success_glyph: String,
pub warn_label: String,
pub error_label: String,
pub debug_label: String,
pub dry_run_prefix: String,
pub color_success: Color,
pub color_warn: Color,
pub color_error: Color,
pub color_debug: Color,
pub color_heading: Color,
pub color_accent: Color,
pub confirm_flag: String,
pub confirm_refusal: String,
pub progress_fill: String,
pub progress_empty: String,
pub progress_width: usize,
}Expand description
All customizable presentation. Construct with Theme::default and override
fields with the builder methods.
Fields§
§success_glyph: StringGlyph placed before a success line (default: none — neutral).
warn_label: StringLabel before a warning (default: "warning:").
error_label: StringLabel before an error (default: "error:").
debug_label: StringLabel before a debug line (default: "debug:").
dry_run_prefix: StringPrefix shown before dry-run actions (default: "[dry-run]").
color_success: ColorUnderlying color roles. Each maps a semantic role to a Color.
color_warn: Color§color_error: Color§color_debug: Color§color_heading: Color§color_accent: Color§confirm_flag: StringThe confirmation flag name for destructive operations. Kept overridable so a tool can word its own confirmation, but defaults to the standard.
confirm_refusal: StringMessage shown when a destructive op is refused for lack of confirmation.
{flag} is replaced with the confirmation flag name.
progress_fill: StringProgress bar fill and empty cells.
progress_empty: String§progress_width: usizeProgress bar width in cells.
Implementations§
Source§impl Theme
impl Theme
pub fn success_glyph<S: Into<String>>(self, s: S) -> Self
pub fn warn_label<S: Into<String>>(self, s: S) -> Self
pub fn error_label<S: Into<String>>(self, s: S) -> Self
pub fn debug_label<S: Into<String>>(self, s: S) -> Self
pub fn dry_run_prefix<S: Into<String>>(self, s: S) -> Self
pub fn confirm_flag<S: Into<String>>(self, s: S) -> Self
pub fn confirm_refusal<S: Into<String>>(self, s: S) -> Self
pub fn color_success(self, c: Color) -> Self
pub fn color_warn(self, c: Color) -> Self
pub fn color_error(self, c: Color) -> Self
pub fn color_heading(self, c: Color) -> Self
pub fn color_accent(self, c: Color) -> Self
pub fn progress_cells<S: Into<String>>(self, fill: S, empty: S) -> Self
pub fn progress_width(self, w: usize) -> Self
Sourcepub fn confirm_refusal_message(&self) -> String
pub fn confirm_refusal_message(&self) -> String
Render the refusal message with the flag name substituted.