Struct superconsole::SuperConsole
source · [−]pub struct SuperConsole { /* private fields */ }
Expand description
Handles rendering the console using the user-defined Components and emitted messages. A Canvas area at the bottom of the terminal is re-rendered in place at each tick for the components, while a log area of emitted messages is produced above. Producing output from sources other than SuperConsole while break the TUI.
Implementations
sourceimpl SuperConsole
impl SuperConsole
sourcepub fn new(root: Box<dyn Component>) -> Option<Self>
pub fn new(root: Box<dyn Component>) -> Option<Self>
Build a new SuperConsole with a root component.
sourcepub fn forced_new(root: Box<dyn Component>, default_size: Dimensions) -> Self
pub fn forced_new(root: Box<dyn Component>, default_size: Dimensions) -> Self
Force a new SuperConsole to be built with a root component, regardless of whether the tty is compatible
pub fn compatible() -> bool
sourcepub fn render(&mut self, state: &State<'_>) -> Result<()>
pub fn render(&mut self, state: &State<'_>) -> Result<()>
Render at a given tick. Draws all components and drains the emitted events buffer. This will produce any pending emitting events above the Canvas and will re-render the drawing area.
sourcepub fn finalize(self, state: &State<'_>) -> Result<()>
pub fn finalize(self, state: &State<'_>) -> Result<()>
Perform a final render. This time, each component will have a chance to finalize themselves before the terminal is disposed of.
sourcepub fn emit_now(&mut self, lines: Lines, state: &State<'_>) -> Result<()>
pub fn emit_now(&mut self, lines: Lines, state: &State<'_>) -> Result<()>
Convenience method:
- Calls queue_emit to add the lines.
- Next, re-renders the
superconsole
.
Because this re-renders the console, it requires passed state.
Overuse of this method can cause superconsole
to use significant CPU.
Auto Trait Implementations
impl !RefUnwindSafe for SuperConsole
impl Send for SuperConsole
impl !Sync for SuperConsole
impl Unpin for SuperConsole
impl !UnwindSafe for SuperConsole
Blanket Implementations
sourceimpl<T> AsARef<T> for T where
T: ?Sized,
impl<T> AsARef<T> for T where
T: ?Sized,
sourcefn try_as_aref(this: &T) -> Result<ARef<'_, T>, BorrowError>
fn try_as_aref(this: &T) -> Result<ARef<'_, T>, BorrowError>
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more