pub struct Gauge<'a> { /* private fields */ }Expand description
Block-fill gauge builder. Auto-renders on Drop.
Constructed via Context::gauge. Chainable .label, .width, .color
methods configure the gauge before it renders. Drop the value to render
without capturing a response, or call Self::show to render and obtain
a GaugeResponse.
Drop is intentional: ui.gauge(0.5).label("CPU"); is the idiomatic form
when the response isn’t needed, mirroring egui’s ui.add(...). Use
Self::show when you need the response.
Implementations§
Source§impl<'a> Gauge<'a>
impl<'a> Gauge<'a>
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Set the centered inline label. Empty string is treated as “no label”.
Accepts both &str and owned String via impl Into<String> so
callers with already-owned strings (e.g. format!(...)) don’t pay a
redundant clone.
Sourcepub fn show(self) -> GaugeResponse
pub fn show(self) -> GaugeResponse
Render now and return the GaugeResponse.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Gauge<'a>
impl<'a> !RefUnwindSafe for Gauge<'a>
impl<'a> !Send for Gauge<'a>
impl<'a> !Sync for Gauge<'a>
impl<'a> Unpin for Gauge<'a>
impl<'a> UnsafeUnpin for Gauge<'a>
impl<'a> !UnwindSafe for Gauge<'a>
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