pub struct Clock { /* private fields */ }Expand description
Analog clock widget. Owns layers in z-order; composes them per frame via dirty-rect union math.
Implementations§
Source§impl Clock
impl Clock
Sourcepub fn new(bounds: Rect) -> Self
pub fn new(bounds: Rect) -> Self
Create a new clock occupying bounds. The first call to
set_target_time will return
TickOutcome::FullRepaint.
Sourcepub fn push_layer<L: ClockLayer + 'static>(&mut self, layer: L)
pub fn push_layer<L: ClockLayer + 'static>(&mut self, layer: L)
Append a layer. Layers paint in insertion order (later layers on top).
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Force the next set_target_time call to be
treated as a full repaint. Use after extent changes, theme changes,
or when the widget re-enters visibility.
Sourcepub fn last_outcome(&self) -> TickOutcome
pub fn last_outcome(&self) -> TickOutcome
Telemetry from the most recent set_target_time call.
Sourcepub fn set_target_time(&mut self, target_time: ClockTime) -> TickOutcome
pub fn set_target_time(&mut self, target_time: ClockTime) -> TickOutcome
Compute the next frame’s plan from the driver-supplied target time. Returns telemetry about what will happen during draw.
Idempotent on a fixed (target_time, bounds) — safe for the driver
to skip frames; absolute-time math means no accumulator drift.
Trait Implementations§
Source§impl Widget for Clock
impl Widget for Clock
Source§fn handle_event(&mut self, _event: &Event) -> bool
fn handle_event(&mut self, _event: &Event) -> bool
Handle an event and return
true if it was consumed. Read moreSource§fn clear_region(&mut self) -> Option<Rect>
fn clear_region(&mut self) -> Option<Rect>
Return a region (in draw/landscape coordinates) that should be
restored from the pristine background copy, or
None. Read moreSource§fn set_bounds(&mut self, _bounds: Rect)
fn set_bounds(&mut self, _bounds: Rect)
Called by the LPAR-10 layout pass to notify this widget of its
layout-computed bounds. Read more
Source§fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
Expose this widget’s font slot for cascade-driven font resolution
(FONT-05 §5.B). Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Clock
impl !Send for Clock
impl !Sync for Clock
impl !UnwindSafe for Clock
impl Freeze for Clock
impl Unpin for Clock
impl UnsafeUnpin for Clock
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