pub struct MultiProgressState { /* private fields */ }Expand description
State for the MultiProgress component.
Implementations§
Source§impl MultiProgressState
impl MultiProgressState
Sourcepub fn with_max_visible(self, max: usize) -> Self
pub fn with_max_visible(self, max: usize) -> Self
Sets the maximum number of visible items.
Sourcepub fn with_auto_remove(self, auto_remove: bool) -> Self
pub fn with_auto_remove(self, auto_remove: bool) -> Self
Sets whether to auto-remove completed items.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Sets the title.
Sourcepub fn with_percentages(self, show: bool) -> Self
pub fn with_percentages(self, show: bool) -> Self
Sets whether to show percentages.
Sourcepub fn add(&mut self, id: impl Into<String>, label: impl Into<String>) -> bool
pub fn add(&mut self, id: impl Into<String>, label: impl Into<String>) -> bool
Adds a new progress item.
Returns true if the item was added (id was unique).
Sourcepub fn items(&self) -> &[ProgressItem]
pub fn items(&self) -> &[ProgressItem]
Returns all items.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Returns the number of completed items.
Sourcepub fn failed_count(&self) -> usize
pub fn failed_count(&self) -> usize
Returns the number of failed items.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Returns the number of active items.
Sourcepub fn overall_progress(&self) -> f32
pub fn overall_progress(&self) -> f32
Returns the overall progress (average of all items).
Sourcepub fn find(&self, id: &str) -> Option<&ProgressItem>
pub fn find(&self, id: &str) -> Option<&ProgressItem>
Finds an item by ID.
Sourcepub fn find_mut(&mut self, id: &str) -> Option<&mut ProgressItem>
pub fn find_mut(&mut self, id: &str) -> Option<&mut ProgressItem>
Finds a mutable item by ID.
Sourcepub fn max_visible(&self) -> usize
pub fn max_visible(&self) -> usize
Returns the maximum visible items.
Sourcepub fn set_max_visible(&mut self, max: usize)
pub fn set_max_visible(&mut self, max: usize)
Sets the maximum visible items.
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Returns the scroll offset.
Sourcepub fn set_scroll_offset(&mut self, offset: usize)
pub fn set_scroll_offset(&mut self, offset: usize)
Sets the scroll offset.
Sourcepub fn show_percentages(&self) -> bool
pub fn show_percentages(&self) -> bool
Returns whether percentages are shown.
Sourcepub fn set_show_percentages(&mut self, show: bool)
pub fn set_show_percentages(&mut self, show: bool)
Sets whether to show percentages.
Sourcepub fn auto_remove_completed(&self) -> bool
pub fn auto_remove_completed(&self) -> bool
Returns whether auto-remove is enabled.
Sourcepub fn set_auto_remove_completed(&mut self, auto_remove: bool)
pub fn set_auto_remove_completed(&mut self, auto_remove: bool)
Sets whether to auto-remove completed items.
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Returns true if the multi-progress is focused.
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Sets the focus state.
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
Returns true if the multi-progress is disabled.
Sourcepub fn set_disabled(&mut self, disabled: bool)
pub fn set_disabled(&mut self, disabled: bool)
Sets the disabled state.
Sourcepub fn with_disabled(self, disabled: bool) -> Self
pub fn with_disabled(self, disabled: bool) -> Self
Sets the disabled state using builder pattern.
Sourcepub fn handle_event(&self, event: &Event) -> Option<MultiProgressMessage>
pub fn handle_event(&self, event: &Event) -> Option<MultiProgressMessage>
Maps an input event to a multi-progress message.
Sourcepub fn dispatch_event(&mut self, event: &Event) -> Option<MultiProgressOutput>
pub fn dispatch_event(&mut self, event: &Event) -> Option<MultiProgressOutput>
Dispatches an event, updating state and returning any output.
Sourcepub fn update(
&mut self,
msg: MultiProgressMessage,
) -> Option<MultiProgressOutput>
pub fn update( &mut self, msg: MultiProgressMessage, ) -> Option<MultiProgressOutput>
Updates the multi-progress state with a message, returning any output.
Trait Implementations§
Source§impl Clone for MultiProgressState
impl Clone for MultiProgressState
Source§fn clone(&self) -> MultiProgressState
fn clone(&self) -> MultiProgressState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MultiProgressState
impl Debug for MultiProgressState
Source§impl Default for MultiProgressState
impl Default for MultiProgressState
Source§impl<'de> Deserialize<'de> for MultiProgressState
impl<'de> Deserialize<'de> for MultiProgressState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MultiProgressState
impl PartialEq for MultiProgressState
Source§impl Serialize for MultiProgressState
impl Serialize for MultiProgressState
impl StructuralPartialEq for MultiProgressState
Auto Trait Implementations§
impl Freeze for MultiProgressState
impl RefUnwindSafe for MultiProgressState
impl Send for MultiProgressState
impl Sync for MultiProgressState
impl Unpin for MultiProgressState
impl UnsafeUnpin for MultiProgressState
impl UnwindSafe for MultiProgressState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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