pub struct Progress { /* private fields */ }Expand description
A horizontal progress bar.
let p = Progress![value = 40.0, label = "Uploading", show_value = true];
let html = render_static(p);
assert!(html.contains(r#"role="progressbar""#) && html.contains(r#"aria-valuenow="40""#) && html.contains("40%"));Implementations§
Source§impl Progress
impl Progress
pub fn new() -> Self
Sourcepub fn class(self, v: impl Into<String>) -> Self
pub fn class(self, v: impl Into<String>) -> Self
Extra classes for the outer element. They win over the defaults.
Sourcepub fn with(self, part: impl Part) -> Self
pub fn with(self, part: impl Part) -> Self
Add an attribute (class(..), id(..), aria(..), …) or a child.
Sourcepub fn value(self, v: f64) -> Self
pub fn value(self, v: f64) -> Self
The current value; none means indeterminate (an animated bar).
pub fn min(self, v: f64) -> Self
pub fn color(self, v: Color) -> Self
pub fn size(self, v: Size) -> Self
pub fn radius(self, v: Radius) -> Self
Sourcepub fn label(self, v: impl Into<String>) -> Self
pub fn label(self, v: impl Into<String>) -> Self
Text above the bar (also its accessible name).
Sourcepub fn show_value(self, v: bool) -> Self
pub fn show_value(self, v: bool) -> Self
Show the percentage at the end of the label line.
Sourcepub fn value_label(self, v: impl Into<String>) -> Self
pub fn value_label(self, v: impl Into<String>) -> Self
Text instead of the percentage (“3 of 8”).
pub fn striped(self, v: bool) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Progress
impl !Sync for Progress
impl !UnwindSafe for Progress
impl Forget for Progress
impl Freeze for Progress
impl Move for Progress
impl Send for Progress
impl Unpin for Progress
impl UnsafeUnpin for Progress
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