Struct stati::ThreadedBarManager
source · [−]pub struct ThreadedBarManager<'bar> { /* private fields */ }
Expand description
A version of BarManager
that can controll bars used across multiple threads
through the ThreadedBarWrapper
. the manager itself cannot be used across multiple threads,
but the bars returned by it can be used in a different thread than it
for more information, see BarManager
Implementations
sourceimpl<'bar> ThreadedBarManager<'bar>
impl<'bar> ThreadedBarManager<'bar>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ThreadedBarManager
sourcepub fn register_bar<B: 'bar + IsBar>(&mut self, bar: B) -> ThreadedBarWrapper<B>
pub fn register_bar<B: 'bar + IsBar>(&mut self, bar: B) -> ThreadedBarWrapper<B>
Registers a progress bar with the bar manager, to be drawn with the manager.
Returns what is effectively a reference to it, and when that refference is dropped or .done()
is called,
the bar is finished, and is completed according to bar.close_method()
pub fn try_flush(&mut self) -> Result<()>
sourcepub fn flush(&mut self)
pub fn flush(&mut self)
Flushes updates to stdout.
Currently this only flushes stdout, but will hopefully do more in the future
Panics
if stdout cannot be flushed
for a non-panicing alternative, see BarManager::try_flush
sourcepub fn queue_text(&mut self, text: &str)
pub fn queue_text(&mut self, text: &str)
Queues text to be printed before the bars. this should NOT be use directly, but should be used with the println! and print! macros
this does NOT immediataly print the text
sourcepub fn print(&mut self)
pub fn print(&mut self)
Prints the bar status and any queued text to stdout, and flushes it.
Panics
if stdout cannot be flushed
for a non-panicing alternative, see ThreadedBarManager::try_print
pub fn try_print(&mut self) -> Result<()>
sourcepub fn print_no_flush(&mut self)
pub fn print_no_flush(&mut self)
Prints the bar status and any queued text to stdout, without flushing it
Trait Implementations
Auto Trait Implementations
impl<'bar> !RefUnwindSafe for ThreadedBarManager<'bar>
impl<'bar> !Send for ThreadedBarManager<'bar>
impl<'bar> !Sync for ThreadedBarManager<'bar>
impl<'bar> Unpin for ThreadedBarManager<'bar>
impl<'bar> !UnwindSafe for ThreadedBarManager<'bar>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more