pub struct Screen {
pub renderable: DynRenderable,
pub style: Option<Style>,
pub application_mode: bool,
}Expand description
A renderable that fills the entire terminal screen, cropping or padding its content to exactly fit the screen dimensions.
Equivalent to Rich’s Screen class.
Fields§
§renderable: DynRenderableThe child renderable.
style: Option<Style>Optional style applied as a background / padding style.
application_mode: boolIf true, use \n\r line endings (application mode for raw terminals).
Implementations§
Source§impl Screen
impl Screen
Sourcepub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Self
pub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Self
Create a new Screen wrapping the given renderable.
Sourcepub fn application_mode(self, mode: bool) -> Self
pub fn application_mode(self, mode: bool) -> Self
Builder: set application mode (uses \n\r instead of \n).
Sourcepub fn update<T>(&mut self, update: T)where
T: Into<ScreenUpdate>,
pub fn update<T>(&mut self, update: T)where
T: Into<ScreenUpdate>,
Update the content renderable.
Trait Implementations§
Source§impl Renderable for Screen
impl Renderable for Screen
Source§fn render(&self, options: &ConsoleOptions) -> RenderResult
fn render(&self, options: &ConsoleOptions) -> RenderResult
Render this object into a
RenderResult using the provided options. Read moreSource§fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
Optional width-measurement hook (equivalent to
__rich_measure__).
Override to provide min/max width constraints for layout.Auto Trait Implementations§
impl Freeze for Screen
impl !RefUnwindSafe for Screen
impl Send for Screen
impl Sync for Screen
impl Unpin for Screen
impl UnsafeUnpin for Screen
impl !UnwindSafe 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