pub enum Mode {
Auto,
Explicit,
UnixTimestamp,
Legacy,
Scientific,
}Expand description
Only relevant for purely numeric dates.
Variants§
Auto
Default mode — Smart heuristic:
- 5/7-digit pure-numeric inside
LEGACY_ORDINAL_YEAR_RANGE→ treated as business ordinal (YYYYDDD / YYDDD) - Outside that range or invalid ordinal → treated as MJD or JD
Explicit
When combined with a provided Vec of formats in parse no other formats are tried.
UnixTimestamp
It’s some sort of unix timestamp
Legacy
Business/legacy-only mode: Only accepts ordinal dates (YYYYDDD / YYDDD). No astronomy (JD/MJD) support. Strict and predictable for ERP/mainframe data.
Scientific
Scientific / astronomy-first mode: Prioritizes MJD (5-digit) and JD (7-digit). Ordinals are only fallback. Use this when parsing data from astronomy tools or large numeric epochs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mode
impl<'de> Deserialize<'de> for Mode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Tsify for Mode
impl Tsify for Mode
const DECL: &'static str = "/**\n * Only relevant for purely numeric dates.\n */\nexport type Mode = \"Auto\" | \"Explicit\" | \"UnixTimestamp\" | \"Legacy\" | \"Scientific\";"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
impl Copy for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more