transitive
Transitive converions through derive macros for Rust.
Rationale:
Assume you have types A, B and C with the following, already implemented, conversions:
A -> BB -> C
Sometimes it might be desirable to have an A -> C implementation which could easily be represented as A -> B -> C.
That is precisely what this crate does. Through the Transitive derive macro, it will implement From or TryFrom respectively
for converting from/to the derived type and a target type, given a path of transitions to go through.
use Transitive;
// impl From<A> for D by doing A -> B -> C -> D
;
// impl From<B> for D by doing B -> C -> D
;
;
;
;
;
;
More examples and explanations can be found in the documentation.
License
Licensed under MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT).
Contributing
Contributions to this repository, unless explicitly stated otherwise, will be considered licensed under MIT. Bugs/issues encountered can be opened here.