pub struct NamedProgressBar {
pub id: String,
pub state: ProgressState,
pub percent: u8,
pub label: Option<String>,
}Expand description
A named progress bar from OSC 934 sequences
OSC 934 supports multiple concurrent progress bars, each identified by a unique string ID. Each bar has a state, percentage, and optional label.
§Protocol Format
OSC 934 ; action ; id [; key=value ...] ST
Actions:
set— create or update a progress barremove— remove a specific progress barremove_all— remove all progress bars
Key-value parameters (for set):
percent=N— progress percentage (0-100, clamped)label=text— descriptive label for the progress barstate=S— state name:normal,indeterminate,warning,error
§Examples
\x1b]934;set;dl-1;percent=50;label=Downloading\x1b\\
\x1b]934;set;dl-1;percent=100;state=normal\x1b\\
\x1b]934;set;build;state=indeterminate;label=Compiling\x1b\\
\x1b]934;set;build;state=error;label=Build failed\x1b\\
\x1b]934;remove;dl-1\x1b\\
\x1b]934;remove_all\x1b\\Fields§
§id: StringUnique identifier for the progress bar
state: ProgressStateCurrent progress state
percent: u8Progress percentage (0-100), only meaningful for Normal/Warning/Error states
label: Option<String>Optional descriptive label
Implementations§
Source§impl NamedProgressBar
impl NamedProgressBar
Sourcepub fn new(
id: String,
state: ProgressState,
percent: u8,
label: Option<String>,
) -> NamedProgressBar
pub fn new( id: String, state: ProgressState, percent: u8, label: Option<String>, ) -> NamedProgressBar
Create a new named progress bar
Trait Implementations§
Source§impl Clone for NamedProgressBar
impl Clone for NamedProgressBar
Source§fn clone(&self) -> NamedProgressBar
fn clone(&self) -> NamedProgressBar
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NamedProgressBar
impl Debug for NamedProgressBar
Source§impl PartialEq for NamedProgressBar
impl PartialEq for NamedProgressBar
impl Eq for NamedProgressBar
impl StructuralPartialEq for NamedProgressBar
Auto Trait Implementations§
impl Freeze for NamedProgressBar
impl RefUnwindSafe for NamedProgressBar
impl Send for NamedProgressBar
impl Sync for NamedProgressBar
impl Unpin for NamedProgressBar
impl UnsafeUnpin for NamedProgressBar
impl UnwindSafe for NamedProgressBar
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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