Closed WhyNotHugo closed 2 years ago
indirectly, you can create a DatePerhapsTime
from a CalendarDateTime
from a NaiveDateTime
from a &str
I think
but we can add another From
impl for this perhaps
This is not a naive date time tho, it's UTC.
My examples weren't the best tho; this field MAY be a CalendarDateTime
or a NaiveDate
. It may specify a timezone which is defined separately, so for DatePerhapsTime.DateTime
, the CalendarDateTime
may be any of the three enum variants. There's quite a few branches, though the converted type should always be Result<DatePerhapsTime>
.
If you think that writing a From
impl is the right approach, I can give it a shot.
Related: I don't quite understand why ParseString
doesn't show up on the docs. Even adding /// A description
and running cargo docs --features parser
, it still won't show up. Is it intentionally omitted?
Never mind, it was simply not exposed. See #45.
Actually, this needs to be TryFrom
, not From
. I'll have a PR soonish.
Is there some helper or shortcut to convert a
ParseString
into anDatePerhapsTime
.I basically have a bunch of these:
There's no docs for ParseString, it's not being generated, apparently. Is this deliberate?