pub struct ConsoleOptions {Show 13 fields
pub min_width: usize,
pub max_width: usize,
pub height: Option<usize>,
pub justify: Justify,
pub overflow: Option<Overflow>,
pub no_wrap: Option<bool>,
pub highlight: Option<bool>,
pub markup: Option<bool>,
pub max_height: usize,
pub encoding: String,
pub is_terminal: bool,
pub legacy_windows: bool,
pub size: ConsoleDimensions,
}Expand description
The options passed to a Renderable describing the space it must fit into.
Port of the core of rich.console.ConsoleOptions. Only the fields needed by
the currently-ported renderables are present; more are added as widgets land.
Fields§
§min_width: usize§max_width: usize§height: Option<usize>§justify: Justify§overflow: Option<Overflow>Overflow method to impose on renderables, or None to let each pick its
own. Mirrors ConsoleOptions.overflow.
no_wrap: Option<bool>Disable wrapping, or None to let each renderable pick. Mirrors
ConsoleOptions.no_wrap.
highlight: Option<bool>Highlight override for strings rendered under these options, or None
for the console default. Mirrors ConsoleOptions.highlight: Panel,
Table and Tree set it for their children, and upstream’s
Console.render passes it to render_str for a str renderable.
markup: Option<bool>Markup override for strings rendered under these options, or None for
the console default. Mirrors ConsoleOptions.markup.
max_height: usizeHeight of the container (starts as the terminal height). Mirrors
ConsoleOptions.max_height.
encoding: StringEncoding of the terminal ("utf-8", or "ascii" for an ASCII-only
console). Mirrors ConsoleOptions.encoding.
is_terminal: boolWhether the target is a terminal. Mirrors ConsoleOptions.is_terminal.
legacy_windows: boolWhether the target is a legacy Windows console. Mirrors
ConsoleOptions.legacy_windows.
size: ConsoleDimensionsThe size of the console. Mirrors ConsoleOptions.size.
Implementations§
Source§impl ConsoleOptions
impl ConsoleOptions
Sourcepub fn update_width(&self, width: usize) -> ConsoleOptions
pub fn update_width(&self, width: usize) -> ConsoleOptions
Return a copy with max_width (and a clamped min_width) updated.
Port of ConsoleOptions.update_width.
Sourcepub fn update_dimensions(&self, width: usize, height: usize) -> ConsoleOptions
pub fn update_dimensions(&self, width: usize, height: usize) -> ConsoleOptions
Return a copy with both width and height pinned. Port of
ConsoleOptions.update_dimensions.
Sourcepub fn update_height(&self, height: usize) -> ConsoleOptions
pub fn update_height(&self, height: usize) -> ConsoleOptions
Return a copy with the height (and max_height) set. Port of
ConsoleOptions.update_height.
Sourcepub fn reset_height(&self) -> ConsoleOptions
pub fn reset_height(&self) -> ConsoleOptions
Return a copy with height cleared. Port of
ConsoleOptions.reset_height.
Sourcepub fn ascii_only(&self) -> bool
pub fn ascii_only(&self) -> bool
Whether renderables should use ASCII only: the encoding is not a UTF
one. Port of the ConsoleOptions.ascii_only property.
Trait Implementations§
Source§impl Clone for ConsoleOptions
impl Clone for ConsoleOptions
Source§impl Debug for ConsoleOptions
impl Debug for ConsoleOptions
Source§impl Default for ConsoleOptions
impl Default for ConsoleOptions
Source§fn default() -> Self
fn default() -> Self
The options of a default 80x25 UTF-8 console, as
Console::options builds them.