Description
We need to deal with the provider API vs. non-provider API in a way that is ergonomic and
sane to deal with rather than keeping them in the same files (Mea culpa).
Currently, if we expose a non with_provider
API, the with_provider
method is still available. So if we make ZonedDateTime::to_ixdtf_string
available then ZonedDateTime::to_ixdtf_string_with_provider
will be available as well.
My initial thought is to separate the the two APIs into separate modules and then expose
them via feature flags.
General proposal overview
The general directory structure would be one of the two below.
NOTE: any bikeshedding on names would be fine by me. I like the core
terminology for the
main implementation, but I'm not entirely convinced std
is a good name. (Sort of mimicking
Rust's core
vs. std
separation).
.
+-- _src
| +-- _core
| +-- _std
| +-- lib.rs
OR
.
+-- _src
| +-- _builtins
| +-- _core
| +-- _std
| +-- mod.rs
| +-- lib.rs
The main idea would be to have all non-feature flagged APIs live in core
. Meanwhile, for
all the general usage APIs (currently flagged "experimental") would be under std
.
The general usage APIs would then just be either a reexport of the core
impl or a
NewType of the core implementations if it has any provider APIs.
Other Options:
- Leave as is, with features in one file with both APIs exposed.
- Other suggestions