ProgressBuilder

Struct ProgressBuilder 

Source
pub struct ProgressBuilder { /* private fields */ }
Expand description

A builder pattern for constructing complex Progress instances.

Use this when you need fine-grained control over initialization, such as setting a specific start time, or injecting existing Arc<Atomic...> instances for shared state management.

Implementations§

Source§

impl ProgressBuilder

Source

pub fn new_bar(name: impl Into<CompactString>, total: impl Into<u64>) -> Self

Starts building a generic Progress Bar (known total).

Source

pub fn new_spinner(name: impl Into<CompactString>) -> Self

Starts building a Spinner (indeterminate total).

Source

pub fn with_atomic_pos(self, atomic_pos: Arc<AtomicU64>) -> Self

Sets a pre-existing atomic counter for position.

This allows multiple Progress instances or external systems to share/update the same position state.

Source

pub fn with_atomic_total(self, atomic_total: Arc<AtomicU64>) -> Self

Sets a pre-existing atomic counter for the total.

Source

pub fn with_atomic_finished(self, atomic_finished: Arc<AtomicBool>) -> Self

Sets a pre-existing atomic boolean for the finished state.

Source

pub const fn with_start_time(self, start: Instant) -> Self

Sets the start time explicitly.

Source

pub fn with_start_time_now(self) -> Self

Sets the start time to Instant::now().

Source

pub fn build(self) -> Progress

Consumes the builder and returns the constructed Progress instance.

Trait Implementations§

Source§

impl Default for ProgressBuilder

Source§

fn default() -> ProgressBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.