pub struct ConsoleBuilder { /* private fields */ }Expand description
Builder for Console, allowing detection to be overridden.
Implementations§
Source§impl ConsoleBuilder
impl ConsoleBuilder
pub fn force_terminal(self, value: bool) -> Self
Sourcepub fn legacy_windows(self, value: bool) -> Self
pub fn legacy_windows(self, value: bool) -> Self
Force legacy-Windows-console behavior (box substitution). Default off.
Sourcepub fn safe_box(self, value: bool) -> Self
pub fn safe_box(self, value: bool) -> Self
Enable/disable terminal-safe box substitution (default on).
Sourcepub fn ascii_only(self, value: bool) -> Self
pub fn ascii_only(self, value: bool) -> Self
Force ASCII-only box rendering (default off). Set for non-UTF-8 terminals.
Sourcepub fn color_system(self, system: Option<ColorSystem>) -> Self
pub fn color_system(self, system: Option<ColorSystem>) -> Self
Force a specific color system (use for reproducible output/tests).
pub fn width(self, width: usize) -> Self
Sourcepub fn no_color(self, value: bool) -> Self
pub fn no_color(self, value: bool) -> Self
Enable no-colour mode: colours are stripped from output while other
attributes (bold, underline, …) still render. Unset, a non-empty
NO_COLOR environment variable enables it. Port of no_color=.
Sourcepub fn get_time(self, clock: impl Fn() -> f64 + Send + Sync + 'static) -> Self
pub fn get_time(self, clock: impl Fn() -> f64 + Send + Sync + 'static) -> Self
Read the current time (seconds) from clock instead of the monotonic
clock. Port of Console(get_time=…); animations such as
Spinner render the frame for this time.
Sourcepub fn emoji(self, value: bool) -> Self
pub fn emoji(self, value: bool) -> Self
Enable/disable :emoji: shortcode replacement (default enabled).
Sourcepub fn highlight(self, value: bool) -> Self
pub fn highlight(self, value: bool) -> Self
Enable/disable automatic repr highlighting. Defaults to on, matching
upstream Console(highlight=True).