RFC | Trait Based Architecture #12
Closed
EstebanBorai
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As more feature requirements and improvement suggestions arise, the need to allow releases on partially supported features also increments.
An example could be the feature request on #7, which aims to provide a MAC addresses field for the
NetworkInterface
struct.So far, support for macOS is on the works, but as such feature is not even in a development phase for other platforms (being Linux and Windows), the release could be delayed to avoid breaking
struct
definitions in other platforms if the API remains the same.To solve such issue, a pattern that allows to provide feature support on different platforms without affecting API definitions on the
NetworkInterface
struct could help.The approach would require the use of a
trait
that may be implemented (or not) based on some platform.Whenever a
trait
is implemented on all supported platforms, a major release could be published normalizing such field as part of the stable struct definition and deprecating thetrait
.Example Usage
This approach could limit a bit usage on multi-platform solutions, but will allow users to consume the crate for certain needs while full support is provided.
Beta Was this translation helpful? Give feedback.
All reactions