clock_tui::app

Enum Mode

Source
pub enum Mode {
    Clock {
        timezone: Option<Tz>,
        no_date: bool,
        no_seconds: bool,
        millis: bool,
    },
    Timer {
        duration: Duration,
        no_millis: bool,
        paused: bool,
        execute: Vec<String>,
    },
    Stopwatch,
    Countdown {
        time: DateTime<Local>,
        title: Option<String>,
        continue_on_zero: bool,
        reverse: bool,
        millis: bool,
    },
}

Variants§

§

Clock

The clock mode displays the current time, the default mode.

Fields

§timezone: Option<Tz>

Custome timezone, for example “America/New_York”, use local timezone if not specificed

§no_date: bool

Do not show date

§no_seconds: bool

Do not show seconds

§millis: bool

Show milliseconds

§

Timer

The timer mode displays the remaining time until the timer is finished.

Fields

§duration: Duration

Initial duration for timer, value can be 10s for 10 seconds, 1m for 1 minute, etc.

§no_millis: bool

Hide milliseconds

§paused: bool

Start the timer paused

§execute: Vec<String>

Command to run when the timer ends

§

Stopwatch

The stopwatch mode displays the elapsed time since it was started.

§

Countdown

The countdown timer mode shows the duration to a specific time

Fields

§time: DateTime<Local>

The target time to countdown to, eg. “2023-01-01”, “20:00”, “2022-12-25 20:00:00” or “2022-12-25T20:00:00-04:00”

§title: Option<String>

Title or description for countdown show in header

§continue_on_zero: bool

Continue to countdown after pass the target time

§reverse: bool

Reverse the countdown, a.k.a. countup

§millis: bool

Show milliseconds

Trait Implementations§

Source§

impl Debug for Mode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Mode

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Mode

Source§

fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>

Append to Command so it can instantiate Self. Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>

Append to Command so it can update self. Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

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.