pub struct ProgressIndicator { /* private fields */ }Expand description
Shared CLI progress renderer for measurable and indeterminate work.
- Determinate (
total > 0):label [=======> ] 42% - Indeterminate (
total == 0): bouncing arrow L↔R inside the bar
Renders on stderr so stdout stays free for machine-readable output.
Non-TTY: silent ticks; only [finish] prints a line.
Implementations§
Source§impl ProgressIndicator
impl ProgressIndicator
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
Start a progress indicator with label (e.g. "BM25", "semantic").
Sourcepub fn set_label(&mut self, label: impl Into<String>)
pub fn set_label(&mut self, label: impl Into<String>)
Change the stage label without finishing (shared indicator across phases).
Sourcepub fn set(&mut self, done: u64, total: u64)
pub fn set(&mut self, done: u64, total: u64)
Set determinate progress. total == 0 switches to indeterminate.
Sourcepub fn indeterminate(&mut self)
pub fn indeterminate(&mut self)
Switch to indeterminate (infinite bouncing arrow).
Sourcepub fn render_line(&self) -> String
pub fn render_line(&self) -> String
Render the current bar line (no \r). Public for tests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProgressIndicator
impl RefUnwindSafe for ProgressIndicator
impl Send for ProgressIndicator
impl Sync for ProgressIndicator
impl Unpin for ProgressIndicator
impl UnsafeUnpin for ProgressIndicator
impl UnwindSafe for ProgressIndicator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more