So I think we have these options:
- Keep the API the same as today with minor breaking changes and an unavoidable performance hit.
- Duplicate the API as it is today so that there is a
Synctype and a non-
Synctype, with minor breaking changes. (e.g., @pixel’s idea or something isomorphic)
Regexand force callers to cheaply clone
Regexto use across multiple threads, with somewhat major breaking changes. (
lazy_static!no longer works.)
- Expose a
Cachetrait and make
Regexpolymorphic over it with a default type parameter, with minor breaking changes.
- Revamp the API in terms of a single trait with multiple implementations, which will break all uses of
regextoday, but breakages should be trivial to fix.
“minor breaking changes” implies small things that I want to fix regardless of what we do here. Only niche uses of
regex should be impacted (e.g., folks who implement the
Replacer trait explicitly).
“major breaking changes” implies many or all uses of
I feel like there is no clearly correct choice here.