Skip to main content

LiveTreeRenderer

Struct LiveTreeRenderer 

Source
pub struct LiveTreeRenderer { /* private fields */ }
Expand description

EventSink that re-renders the cascade tree to stdout in place every RoundCompleted (and Finished). Uses ANSI cursor positioning so the tree fills in line-by-line as the cascade unfolds — same idiom nix-output-monitor (nom) uses.

Usage: hand to Cascade::new()...events(&renderer).run() for default “watch the cascade unfold” behavior in any TTY-attached cli bin.

Caller is responsible for not wiring this when stdout is a pipe — it would emit ANSI escapes into the captured output. crate::output handles the TTY check.

Implementations§

Source§

impl LiveTreeRenderer

Source

pub fn new(color: bool, max_depth: Option<usize>) -> Self

Source

pub fn with_max_height(self, h: Option<usize>) -> Self

Builder: set an explicit maximum frame height (lines). Used for tests that can’t rely on a real terminal. Some(0) disables height capping.

In production the height is auto-detected from the terminal on each paint via console::Term::stdout().size().

Source

pub fn with_header_text(self, text: impl Into<String>) -> Self

Builder: replace the default "Cascade deploy" header with a single custom line.

Source

pub fn with_header_lines(self, lines: Vec<String>) -> Self

Builder: provide multiple header lines. The first renders with ┏━ (top-left), each subsequent line renders with ┣ (T-junction) — matches nom’s section convention. Use to keep a wide header readable on narrow terminals without truncation:

ⓘ
LiveTreeRenderer::new(color, max_depth)
    .with_header_lines(vec![
        format!("Strategy: {} || Nodes: {}", name, n),
        format!("Fanout: {} || Failures: {}%", f, fr),
    ])

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V