pub struct ProgressBar {
pub progress: f32,
pub left_text: Option<String>,
pub center_text: Option<String>,
pub right_text: Option<String>,
pub animate: bool,
pub is_indeterminate: bool,
pub desired_width: Option<f32>,
pub desired_height: Option<f32>,
}
Expand description
A progress bar that supports both determinate ([0->100]
) and indeterminate modes.
Fields§
§progress: f32
Progress across the bar, in the range [0->1]
left_text: Option<String>
Text to left align inside of the bar
center_text: Option<String>
Text to center align inside of the bar
right_text: Option<String>
Text to right align inside of the bar
animate: bool
Request an immediate repaint of the bar
is_indeterminate: bool
The indicated progress is ignored, and the bar bounces back and forth
desired_width: Option<f32>
The desired draw width of the bar
desired_height: Option<f32>
The desired draw height of the bar
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn new(progress: f32) -> ProgressBar
pub fn new(progress: f32) -> ProgressBar
Creates a new progress bar with the specified determinate progress in the range [0,1]
Sourcepub fn indeterminate() -> ProgressBar
pub fn indeterminate() -> ProgressBar
Creates a new progress bar that is indeterminate. The little bar will bounce back and forth to indicate stuff is happening.
Sourcepub fn text(self, text: String) -> ProgressBar
pub fn text(self, text: String) -> ProgressBar
The same as Self::text_left
Sourcepub fn text_left(self, text: String) -> ProgressBar
pub fn text_left(self, text: String) -> ProgressBar
Draws the provided text left aligned
Sourcepub fn text_center(self, text: String) -> ProgressBar
pub fn text_center(self, text: String) -> ProgressBar
Draws the provided text center aligned
Sourcepub fn text_right(self, text: String) -> ProgressBar
pub fn text_right(self, text: String) -> ProgressBar
Draws the provided text right aligned
Sourcepub fn desired_width(self, width: f32) -> ProgressBar
pub fn desired_width(self, width: f32) -> ProgressBar
Sets the desired draw width of the bar
Sourcepub fn desired_height(self, height: f32) -> ProgressBar
pub fn desired_height(self, height: f32) -> ProgressBar
Sets the desired draw height of the bar
pub fn ui(self, ui: &mut Ui) -> Response
Trait Implementations§
Source§impl Clone for ProgressBar
impl Clone for ProgressBar
Source§fn clone(&self) -> ProgressBar
fn clone(&self) -> ProgressBar
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProgressBar
impl Debug for ProgressBar
Source§impl Default for ProgressBar
impl Default for ProgressBar
Source§fn default() -> ProgressBar
fn default() -> ProgressBar
Auto Trait Implementations§
impl Freeze for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnwindSafe for ProgressBar
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> 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>
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>
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)
&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)
&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<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>
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