pub struct ConsoleOptions {
pub min_width: usize,
pub max_width: usize,
pub height: Option<usize>,
pub justify: Justify,
pub overflow: Option<Overflow>,
pub no_wrap: Option<bool>,
}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.
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.
Trait Implementations§
Source§impl Clone for ConsoleOptions
impl Clone for ConsoleOptions
Source§fn clone(&self) -> ConsoleOptions
fn clone(&self) -> ConsoleOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConsoleOptions
impl RefUnwindSafe for ConsoleOptions
impl Send for ConsoleOptions
impl Sync for ConsoleOptions
impl Unpin for ConsoleOptions
impl UnsafeUnpin for ConsoleOptions
impl UnwindSafe for ConsoleOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more