pub struct Screen { /* private fields */ }Expand description
A renderable that fills the screen and crops excess. Mirrors
rich.screen.Screen.
Implementations§
Source§impl Screen
impl Screen
Sourcepub fn new(renderable: Box<dyn Renderable>) -> Self
pub fn new(renderable: Box<dyn Renderable>) -> Self
A screen filled with renderable.
Sourcepub fn from_renderables(renderables: Vec<Box<dyn Renderable>>) -> Self
pub fn from_renderables(renderables: Vec<Box<dyn Renderable>>) -> Self
A screen of several renderables, one after another: upstream’s
Screen(*renderables), which groups them.
Sourcepub fn style(self, style: impl Into<StyleType>) -> Self
pub fn style(self, style: impl Into<StyleType>) -> Self
Set a background style applied under the whole screen (upstream
style=): a Style, or a theme name or style
definition resolved at render time.
Sourcepub fn application_mode(self, application_mode: bool) -> Self
pub fn application_mode(self, application_mode: bool) -> Self
Separate rows with "\n\r" rather than "\n" (upstream
application_mode=), for a terminal in application mode.
Trait Implementations§
Source§impl Renderable for Screen
impl Renderable for Screen
Source§fn print_end_line(&self, _options: &ConsoleOptions) -> bool
fn print_end_line(&self, _options: &ConsoleOptions) -> bool
Upstream ends a Screen with its last row, without a line break, so a
printed Screen leaves the cursor on that row.
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
The
(minimum, maximum) cell width this renderable wants. Port of
__rich_measure__. The default is what upstream’s Measurement.get
returns for a renderable without one: anything from nothing to the
whole width, (0, max_width).Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Whether a top-level
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.Auto Trait Implementations§
impl !RefUnwindSafe for Screen
impl !Send for Screen
impl !Sync for Screen
impl !UnwindSafe for Screen
impl Freeze for Screen
impl Unpin for Screen
impl UnsafeUnpin for Screen
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