diff --git a/src/timescale.rs b/src/timescale.rs index 7d34106d..cae78bfc 100644 --- a/src/timescale.rs +++ b/src/timescale.rs @@ -11,6 +11,9 @@ #[cfg(feature = "python")] use pyo3::prelude::*; +#[cfg(feature = "serde")] +use serde_derive::{Deserialize, Serialize}; + use core::str::FromStr; use crate::{Duration, Epoch, Errors, ParsingErrors, SECONDS_PER_DAY}; @@ -50,6 +53,7 @@ pub const UNIX_REF_EPOCH: Epoch = Epoch::from_tai_duration(Duration { /// Enum of the different time systems available #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "python", pyclass)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum TimeScale { /// TAI is the representation of an Epoch internally TAI,