pub struct AkarProgress { /* private fields */ }Expand description
A thin wrapper around indicatif::ProgressBar for Akar operations.
Provides factory methods for common progress styles (spinner, count-based, bytes-transferred) used during bulk ingest, export, and long-running queries.
§Example
use akar_common::progress_bar::AkarProgress;
let pb = AkarProgress::new("Loading data…", Some(1000));
for i in 0..1000 {
pb.inc();
std::thread::sleep(std::time::Duration::from_millis(1));
}
pb.finish("Done.");Implementations§
Source§impl AkarProgress
impl AkarProgress
Sourcepub fn new(msg: &str, total: Option<u64>) -> Self
pub fn new(msg: &str, total: Option<u64>) -> Self
Create a new progress bar with an optional total count.
When total is None, a spinner is used (indeterminate progress).
When total is Some(n), a count-based bar is shown.
Sourcepub fn set_message(&self, msg: &str)
pub fn set_message(&self, msg: &str)
Update the message displayed alongside the bar.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Mark as cancelled. Callers should check Self::is_cancelled in their
work loop to abort early.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether a cancellation has been requested.
Sourcepub fn cancelled_flag(&self) -> Arc<AtomicBool> ⓘ
pub fn cancelled_flag(&self) -> Arc<AtomicBool> ⓘ
Get a reference to the cancellation flag for sharing across threads.
Trait Implementations§
Source§impl Drop for AkarProgress
impl Drop for AkarProgress
Auto Trait Implementations§
impl Freeze for AkarProgress
impl RefUnwindSafe for AkarProgress
impl Send for AkarProgress
impl Sync for AkarProgress
impl Unpin for AkarProgress
impl UnsafeUnpin for AkarProgress
impl UnwindSafe for AkarProgress
Blanket Implementations§
impl<T> Allocation for T
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> 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