Struct redblocks::plugins::TimePlugin [−][src]
Expand description
Displays the current time.
Using the default configuration
formats to “Saturday 06/26/2021 3:41:48 pm”
#[macro_use] extern crate redblocks; use redblocks::{plugins::TimePlugin, Widget}; fn main() { let time = Box::new(TimePlugin::default()); let time = vec![Widget::new(time, 1)]; start_bar!(time); }
Using a custom format
for formating options see the strftime module
#[macro_use] extern crate redblocks; use redblocks::{plugins::TimePlugin, Widget}; fn main() { let time = TimePlugin::new("%H%M%S"); // formats to "14:23:08" let time = vec![Widget::new(time, 1)]; start_bar!(time); }
Fields
time: String
holds the time formated as a string
format: String
holds the formating string
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TimePlugin
impl Send for TimePlugin
impl Sync for TimePlugin
impl Unpin for TimePlugin
impl UnwindSafe for TimePlugin