pub struct TerminalSink { /* private fields */ }Expand description
A Sink that paints a single, self-overwriting progress line.
- On a TTY:
\r-carriage-return redraw of one dim line, throttled to one repaint perCOMMIT_TICK_INTERVALunits (plus forced repaint on phase change and on the first/last unit). - Off a TTY (piped human output): one dim line per throttled tick, no control codes.
The sink is Sync; its small amount of interior state (last painted phase +
tick bookkeeping) lives behind a Mutex. Renders are cheap and infrequent
relative to inc, so the lock is not on any hot path.
Implementations§
Source§impl TerminalSink
impl TerminalSink
pub fn new() -> TerminalSink
Trait Implementations§
Source§impl Default for TerminalSink
impl Default for TerminalSink
Source§fn default() -> TerminalSink
fn default() -> TerminalSink
Returns the “default value” for a type. Read more
Source§impl Sink for TerminalSink
impl Sink for TerminalSink
Source§fn render(&self, snap: ProgressSnapshot)
fn render(&self, snap: ProgressSnapshot)
Present the given snapshot. Called on the thread that drove the update;
may be called concurrently from multiple threads, so implementations
must be
Sync and manage their own interior state.Auto Trait Implementations§
impl !Freeze for TerminalSink
impl RefUnwindSafe for TerminalSink
impl Send for TerminalSink
impl Sync for TerminalSink
impl Unpin for TerminalSink
impl UnsafeUnpin for TerminalSink
impl UnwindSafe for TerminalSink
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request