pub struct Clock { /* private fields */ }
Expand description
Displays the current time, updating at a given precision.
Uses an Interval
to update as close to the unit boundaries as possible.
Available actions: cycle
and cycle_back
to change the format that is
used
Trait Implementations§
Source§impl PanelConfig for Clock
impl PanelConfig for Clock
Source§fn parse(
name: &'static str,
table: &mut HashMap<String, Value>,
_global: &Config,
) -> Result<Self>
fn parse( name: &'static str, table: &mut HashMap<String, Value>, _global: &Config, ) -> Result<Self>
Parses an instance of the panel from the global Config
Configuration options:
formats
: The format strings to use. SeePanelCommon::parse_formats_variadic
. Seechrono::format::strftime
for clock-specific formatting details.precisions
: An array of strings specifying the precision required for each format. This must be the same length as theformats
array. Each precision should be one ofseconds
,minutes
,hours
, anddays
. The default for each precision isseconds
.precision
: Specify the precision for all formats. Only used ifprecisions
is unset.attrs
: An array specifying the attrs for each format. SeeAttrs::parse
for details. This must be the same length as theformats
array.attr
: A string specifying the attrs for each format. Only checked ifattrs
is unset.offset
: This panel will anticipate a delay of this many milliseconds and trigger early. The default value is 1.- See
PanelCommon::parse_common
. The supported events arecycle
andcycle_back
.
Source§fn props(&self) -> (&'static str, bool)
fn props(&self) -> (&'static str, bool)
Returns the name of the panel. If the panel supports events, each
instance must return a unique name.
Source§fn run<'async_trait>(
self: Box<Self>,
cr: Rc<Context>,
global_attrs: Attrs,
height: i32,
) -> Pin<Box<dyn Future<Output = PanelRunResult> + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Box<Self>,
cr: Rc<Context>,
global_attrs: Attrs,
height: i32,
) -> Pin<Box<dyn Future<Output = PanelRunResult> + 'async_trait>>where
Self: 'async_trait,
Performs any necessary setup, then returns a
PanelStream
representing the provided PanelConfig
. Read moreAuto Trait Implementations§
impl Freeze for Clock
impl !RefUnwindSafe for Clock
impl !Send for Clock
impl !Sync for Clock
impl Unpin for Clock
impl !UnwindSafe 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