pub struct ProgressBar<T = &'static str> { /* private fields */ }
Expand description
Builder for a progress bar widget.
§Examples
ProgressBar::new(0.6)
.size([100.0, 12.0])
.overlay_text("Progress!")
.build(&ui);
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn new(fraction: f32) -> ProgressBar
pub fn new(fraction: f32) -> ProgressBar
Creates a progress bar with a given fraction showing the progress (0.0 = 0%, 1.0 = 100%).
The progress bar will be automatically sized to fill the entire width of the window if no custom size is specified.
Source§impl<T> ProgressBar<T>
impl<T> ProgressBar<T>
Sourcepub fn overlay_text<T2>(self, overlay_text: T2) -> ProgressBar<T2>
pub fn overlay_text<T2>(self, overlay_text: T2) -> ProgressBar<T2>
Sets an optional text that will be drawn over the progress bar.
Trait Implementations§
Source§impl<T> Clone for ProgressBar<T>where
T: Clone,
impl<T> Clone for ProgressBar<T>where
T: Clone,
Source§fn clone(&self) -> ProgressBar<T>
fn clone(&self) -> ProgressBar<T>
Returns a copy 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<T> Debug for ProgressBar<T>where
T: Debug,
impl<T> Debug for ProgressBar<T>where
T: Debug,
impl<T> Copy for ProgressBar<T>where
T: Copy,
Auto Trait Implementations§
impl<T> Freeze for ProgressBar<T>where
T: Freeze,
impl<T> RefUnwindSafe for ProgressBar<T>where
T: RefUnwindSafe,
impl<T> Send for ProgressBar<T>where
T: Send,
impl<T> Sync for ProgressBar<T>where
T: Sync,
impl<T> Unpin for ProgressBar<T>where
T: Unpin,
impl<T> UnwindSafe for ProgressBar<T>where
T: UnwindSafe,
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> 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