The Model trait is already a pretty foundational abstraction, but the Encoder and Decoder are concrete implementations.
Making these into traits would be easy enough to do, if it was useful. The traits would be in arithmetic-coding-core and would allow consumers to integrate third-party algorithms with existing infrastructure that made use of the Model trait.
necessary conditions to bother doing this:
- "sufficient" use of this library in the wild that third-party integration is a useful goal. (ie someone asks me to, and can at least sort of justify it)
- the existence of significantly faster/better third-party encoders/decoders, that can't or won't be upstreamed into this crate
- this also assumes that the
Model trait is at least roughly appropriate for these algorithms to consume
If the above conditions are met, then making the encoder/decoder into traits starts to make sense.
The
Modeltrait is already a pretty foundational abstraction, but the Encoder and Decoder are concrete implementations.Making these into traits would be easy enough to do, if it was useful. The traits would be in
arithmetic-coding-coreand would allow consumers to integrate third-party algorithms with existing infrastructure that made use of theModeltrait.necessary conditions to bother doing this:
Modeltrait is at least roughly appropriate for these algorithms to consumeIf the above conditions are met, then making the encoder/decoder into traits starts to make sense.