Crate replaceable_implementations

Source
Expand description

Allows implementations to be replaced.
Designed for use in procedural macros.
Documentation
Crate
Change Log

§Explanation

I will explain how this works soon.
Basically, it creates switches that implementations rely on, that then later get disabled.

§License

Licensed under either of

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Functions§

initial_implementation
Provides an initial implementation.
Any other implementations will replace this one, no matter the execution order.
replace_implementation
Replaces the previous implementation marked by the id with a new implementation.
Returns the quantity of previous implementations as well as the function that will actually replace the implementation.
setup
Due to orphan rules, we need to perform some setup.
This should be put in one spot that you know the path to. That could be the crate root, or a specific module that is passed into your macros. It is up to you.
The capacity is used to set the max number of implementations that can be replaced.