1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-05-31 15:40:51 +00:00
starship/src/configs/cmd_duration.rs
2022-04-01 17:14:05 +02:00

33 lines
914 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "config-schema", derive(schemars::JsonSchema))]
#[serde(default)]
pub struct CmdDurationConfig<'a> {
pub min_time: i64,
pub format: &'a str,
pub style: &'a str,
pub show_milliseconds: bool,
pub disabled: bool,
pub show_notifications: bool,
pub min_time_to_notify: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_timeout: Option<u32>,
}
impl<'a> Default for CmdDurationConfig<'a> {
fn default() -> Self {
CmdDurationConfig {
min_time: 2_000,
format: "took [$duration]($style) ",
show_milliseconds: false,
style: "yellow bold",
disabled: false,
show_notifications: false,
min_time_to_notify: 45_000,
notification_timeout: None,
}
}
}