Struct lazybar_core::panels::Clock
source · 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>
Configuration options:
formats: The format strings to use. SeePanelCommon::parse_formats_variadic. Seechrono::format::strftimefor clock-specific formatting details.precisions: An array of strings specifying the precision required for each format. This must be the same length as theformatsarray. Each precision should be one ofseconds,minutes,hours, anddays. The default for each precision isseconds.precision: Specify the precision for all formats. Only checked ifprecisionsis unset.attrs: An array specifying the attrs for each format. SeeAttrs::parsefor details. This must be the same length as theformatsarray.attr: A string specifying the attrs for each format. Only checked ifattrsis 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 arecycleandcycle_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 = Result<(PanelStream, Option<ChannelEndpoint<Event, EventResponse>>)>> + '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 = Result<(PanelStream, Option<ChannelEndpoint<Event, EventResponse>>)>> + '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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)