A downstream crate I use exposes an API that takes strings, converts them to Schedules, which may fail.
Ideally, I'd like to construct Schedules myself and pass them to the crate's functions, and handle possible errors before the library has a chance to produce errors.
For this to be practical, it would need to avoid breaking API compatibility so severely, and the best way to do that would be for their functions to take the schedule argument as a S: TryInto<cron::Schedule>.
If TryFrom<&str> for Schedule is implemented, this will allow the functions to take &strs like they do currently, as well as support taking cron::Schedule, since it has a blanket impl for TryFrom<T> for T.
A downstream crate I use exposes an API that takes strings, converts them to Schedules, which may fail. Ideally, I'd like to construct Schedules myself and pass them to the crate's functions, and handle possible errors before the library has a chance to produce errors. For this to be practical, it would need to avoid breaking API compatibility so severely, and the best way to do that would be for their functions to take the schedule argument as a
S: TryInto<cron::Schedule>
.If
TryFrom<&str> for Schedule
is implemented, this will allow the functions to take&str
s like they do currently, as well as support takingcron::Schedule
, since it has a blanket impl forTryFrom<T> for T
.