ProgressBar

Struct ProgressBar 

Source
pub struct ProgressBar { /* private fields */ }
Expand description

Progress bar widget.

Implementations§

Source§

impl ProgressBar

Source

pub fn new() -> Self

Create a new progress bar.

Source

pub fn with_value(value: f32) -> Self

Create a progress bar with the given value.

Source

pub fn value(self, value: f32) -> Self

Set the progress value (clamped to 0.0..=1.0).

Source

pub const fn mode(self, mode: ProgressMode) -> Self

Set the progress mode.

Source

pub const fn indeterminate(self) -> Self

Set indeterminate mode.

Source

pub fn min_width(self, width: f32) -> Self

Set the minimum width.

Source

pub fn height(self, height: f32) -> Self

Set the height.

Source

pub fn corner_radius(self, radius: f32) -> Self

Set the corner radius.

Source

pub const fn track_color(self, color: Color) -> Self

Set the track color (background).

Source

pub const fn fill_color(self, color: Color) -> Self

Set the fill color (progress).

Source

pub const fn with_label(self) -> Self

Show percentage label.

Source

pub const fn show_label(self, show: bool) -> Self

Set whether to show the label.

Source

pub const fn label_color(self, color: Color) -> Self

Set the label color.

Source

pub fn accessible_name(self, name: impl Into<String>) -> Self

Set the accessible name.

Source

pub fn test_id(self, id: impl Into<String>) -> Self

Set the test ID.

Source

pub const fn get_value(&self) -> f32

Get the current value.

Source

pub const fn get_mode(&self) -> ProgressMode

Get the current mode.

Source

pub fn percentage(&self) -> u8

Get the percentage (0-100).

Source

pub fn is_complete(&self) -> bool

Check if progress is complete.

Source

pub fn is_indeterminate(&self) -> bool

Check if indeterminate.

Source

pub fn set_value(&mut self, value: f32)

Set the value directly (mutable).

Source

pub fn increment(&mut self, delta: f32)

Increment the value by a delta.

Source

pub const fn get_track_color(&self) -> Color

Get the track color.

Source

pub const fn get_fill_color(&self) -> Color

Get the fill color.

Source

pub const fn get_label_color(&self) -> Color

Get the label color.

Source

pub const fn is_label_shown(&self) -> bool

Get whether label is shown.

Source

pub const fn get_min_width(&self) -> f32

Get the minimum width.

Source

pub const fn get_height(&self) -> f32

Get the height.

Source

pub const fn get_corner_radius(&self) -> f32

Get the corner radius.

Trait Implementations§

Source§

impl Brick for ProgressBar

Source§

fn brick_name(&self) -> &'static str

Get the brick’s unique type name
Source§

fn assertions(&self) -> &[BrickAssertion]

Get all assertions for this brick
Source§

fn budget(&self) -> BrickBudget

Get the performance budget
Source§

fn verify(&self) -> BrickVerification

Verify all assertions against current state Read more
Source§

fn to_html(&self) -> String

Generate HTML for this brick (WASM target) Read more
Source§

fn to_css(&self) -> String

Generate CSS for this brick (WASM target) Read more
Source§

fn test_id(&self) -> Option<&str>

Get the test ID for DOM queries
Source§

fn can_render(&self) -> bool

Check if this brick can be rendered (all assertions pass)
Source§

impl Clone for ProgressBar

Source§

fn clone(&self) -> ProgressBar

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProgressBar

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProgressBar

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ProgressBar

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ProgressBar

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Widget for ProgressBar

Source§

fn type_id(&self) -> TypeId

Get the type identifier for this widget type.
Source§

fn measure(&self, constraints: Constraints) -> Size

Compute intrinsic size constraints.
Source§

fn layout(&mut self, bounds: Rect) -> LayoutResult

Position children within allocated bounds.
Source§

fn paint(&self, canvas: &mut dyn Canvas)

Generate draw commands for rendering. Read more
Source§

fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>

Handle input events.
Source§

fn children(&self) -> &[Box<dyn Widget>]

Get child widgets for tree traversal.
Source§

fn children_mut(&mut self) -> &mut [Box<dyn Widget>]

Get mutable child widgets.
Source§

fn is_interactive(&self) -> bool

Check if this widget is interactive (can receive focus/events).
Source§

fn is_focusable(&self) -> bool

Check if this widget can receive keyboard focus.
Source§

fn accessible_name(&self) -> Option<&str>

Get the accessible name for screen readers.
Source§

fn accessible_role(&self) -> AccessibleRole

Get the accessible role.
Source§

fn test_id(&self) -> Option<&str>

Get the test ID for this widget (if any).
Source§

fn bounds(&self) -> Rect

Get the current bounds of this widget.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BrickWidgetExt for T
where T: Brick,

Source§

fn verify_for_render(&self) -> Result<(), String>

Verify this brick before rendering. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,