pub struct RenderResult {
pub lines: Vec<Vec<Segment>>,
pub items: Vec<RenderItem>,
}Expand description
The result of rendering: a list of lines, each line being a list of
segments. Also carries an optional items list for recursive rendering.
Fields§
§lines: Vec<Vec<Segment>>Flat line-oriented segments (backward-compatible).
items: Vec<RenderItem>Optional render items for recursive flattening. When present,
Console::render() recurses into nested renderables.
Implementations§
Source§impl RenderResult
impl RenderResult
pub fn new() -> Self
pub fn from_text(text: &str) -> Self
pub fn from_segments(segments: Vec<Segment>) -> Self
pub fn from_lines(lines: Vec<Vec<Segment>>) -> Self
pub fn from_items(items: Vec<RenderItem>) -> Self
Sourcepub fn push_item(&mut self, item: impl Into<RenderItem>)
pub fn push_item(&mut self, item: impl Into<RenderItem>)
Push a segment item.
Sourcepub fn push_renderable(&mut self, r: impl Renderable + Send + Sync + 'static)
pub fn push_renderable(&mut self, r: impl Renderable + Send + Sync + 'static)
Push a nested renderable for recursive flattening.
Sourcepub fn flatten(&self, options: &ConsoleOptions) -> Vec<Segment>
pub fn flatten(&self, options: &ConsoleOptions) -> Vec<Segment>
Recursively flatten items into segments using the given options.
This is called by Console::render() to resolve nested renderables.
Trait Implementations§
Source§impl Clone for RenderResult
impl Clone for RenderResult
Source§fn clone(&self) -> RenderResult
fn clone(&self) -> RenderResult
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 RenderResult
impl !RefUnwindSafe for RenderResult
impl Send for RenderResult
impl Sync for RenderResult
impl Unpin for RenderResult
impl UnsafeUnpin for RenderResult
impl !UnwindSafe for RenderResult
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