1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use serde::{Deserialize, Serialize}; /** The pipelight simple duration object that abstract standart and chrono crates duration usage. Implements convenient methods. */ #[derive(Default, Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] pub struct Duration { // iso8601 date string pub started_at: Option<String>, // iso8601 date string pub ended_at: Option<String>, // iso8601 duration string #[serde(skip)] pub computed: Option<String>, }