pub struct ProgressHandler { /* private fields */ }Expand description
EventHandler that drives an indicatif ProgressBar on each node completion.
Pass as user_handler to task.schedule(). The TaskGatheringHandler
chains on_close/on_timeout to us — no core changes needed.
ProgressBar is internally Arc’d, so updates from the poll thread are immediately visible to the steady-tick render thread.
Implementations§
Source§impl ProgressHandler
impl ProgressHandler
pub fn new(state: ProgressState, bar: ProgressBar) -> Self
Trait Implementations§
Source§impl EventHandler for ProgressHandler
impl EventHandler for ProgressHandler
Source§fn on_timeout(&mut self, _node: &str)
fn on_timeout(&mut self, _node: &str)
Called when a node operation times out.
Source§fn on_read(&mut self, node: &str, fd: i32, msg: &[u8])
fn on_read(&mut self, node: &str, fd: i32, msg: &[u8])
Called when data is available for reading from a node.
Source§fn on_error(&mut self, node: &str, error: &WorkerError)
fn on_error(&mut self, node: &str, error: &WorkerError)
Called when an error occurs for a node.
Source§fn take_buffers(
&mut self,
) -> (HashMap<String, Vec<Vec<u8>>>, HashMap<String, Vec<Vec<u8>>>, HashSet<String>)
fn take_buffers( &mut self, ) -> (HashMap<String, Vec<Vec<u8>>>, HashMap<String, Vec<Vec<u8>>>, HashSet<String>)
Extract buffered stdout/stderr data from this handler.
Returns (stdout, stderr, timeouts) where stdout/stderr are node ->
Vec<chunks>.
Default returns empty maps. Used by Task to collect results after execution.Auto Trait Implementations§
impl Freeze for ProgressHandler
impl RefUnwindSafe for ProgressHandler
impl Send for ProgressHandler
impl Sync for ProgressHandler
impl Unpin for ProgressHandler
impl UnsafeUnpin for ProgressHandler
impl UnwindSafe for ProgressHandler
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