pub struct ConsoleOptions {Show 13 fields
pub size: ConsoleDimensions,
pub legacy_windows: bool,
pub min_width: usize,
pub max_width: usize,
pub is_terminal: bool,
pub encoding: Cow<'static, str>,
pub max_height: usize,
pub justify: Option<JustifyMethod>,
pub overflow: Option<OverflowMethod>,
pub no_wrap: Option<bool>,
pub highlight: Option<bool>,
pub markup: Option<bool>,
pub height: Option<usize>,
}Expand description
Options that control how renderables produce segments.
Fields§
§size: ConsoleDimensionsTerminal dimensions used for layout.
legacy_windows: boolWhether to use legacy Windows console rendering.
min_width: usizeMinimum width in columns for renderable output.
max_width: usizeMaximum width in columns for renderable output.
is_terminal: boolWhether the output target is an interactive terminal.
encoding: Cow<'static, str>Character encoding (always "utf-8" in Rust; Cow avoids allocation
per options() call while still letting tests set non-utf encodings
for ascii_only() checks — finding #6).
max_height: usizeMaximum height in rows for renderable output.
justify: Option<JustifyMethod>Text justification override, if any.
overflow: Option<OverflowMethod>Text overflow strategy override, if any.
no_wrap: Option<bool>Whether to disable text wrapping.
Tri-state (rich parity):
None= inherit / wrap by defaultSome(false)= force-wrap (explicit wrap)Some(true)= no-wrap (suppress wrapping)
Only Some(true) suppresses wrapping; None and Some(false) both wrap.
highlight: Option<bool>Whether to enable syntax highlighting, if set.
markup: Option<bool>Whether to enable markup parsing, if set.
height: Option<usize>Explicit height constraint for renderables, if set.
Implementations§
Source§impl ConsoleOptions
impl ConsoleOptions
Sourcepub fn ascii_only(&self) -> bool
pub fn ascii_only(&self) -> bool
Returns true if the encoding is NOT utf-based (i.e. ASCII-only output).
Sourcepub fn update_width(&self, width: usize) -> Self
pub fn update_width(&self, width: usize) -> Self
Return a new ConsoleOptions with the width replaced.
min_width is clamped so it never exceeds the new width (finding #3).
Sourcepub fn update_height(&self, height: usize) -> Self
pub fn update_height(&self, height: usize) -> Self
Return a new ConsoleOptions with the height replaced.
Sourcepub fn update_dimensions(&self, width: usize, height: usize) -> Self
pub fn update_dimensions(&self, width: usize, height: usize) -> Self
Return a new ConsoleOptions with both width and height replaced.
Sourcepub fn reset_height(&self) -> Self
pub fn reset_height(&self) -> Self
Return a new ConsoleOptions with height reset to None.
Sourcepub fn with_updates(&self, updates: &ConsoleOptionsUpdates) -> Self
pub fn with_updates(&self, updates: &ConsoleOptionsUpdates) -> Self
Apply a set of optional field updates, returning a new ConsoleOptions.
Trait Implementations§
Source§impl Clone for ConsoleOptions
impl Clone for ConsoleOptions
Source§fn clone(&self) -> ConsoleOptions
fn clone(&self) -> ConsoleOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more