Skip to main content

Clock

Struct Clock 

Source
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

Source

pub fn new(bounds: Rect) -> Self

Create a new clock occupying bounds. The first call to set_target_time will return TickOutcome::FullRepaint.

Source

pub fn push_layer<L: ClockLayer + 'static>(&mut self, layer: L)

Append a layer. Layers paint in insertion order (later layers on top).

Source

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.

Source

pub fn last_outcome(&self) -> TickOutcome

Telemetry from the most recent set_target_time call.

Source

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

Source§

fn bounds(&self) -> Rect

Return the area this widget occupies relative to its parent.
Source§

fn draw(&self, renderer: &mut dyn Renderer)

Render the widget using the provided Renderer.
Source§

fn handle_event(&mut self, _event: &Event) -> bool

Handle an event and return true if it was consumed. Read more
Source§

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

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>

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> 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> 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, 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.