I'd like to publicly use the public API of a third party crate while implementing a new crate.
For example, suppose I'm implementing a crate my_serializer
which needs some kind of u7
type. This doesn't exist in the core language, or standard library but there's a nice implementation in the external crate ux
. It would be very convenient to do the following:
// my_serializer/lib.rs
extern crate ux;
pub type U7 = ux::u7;
But this forces clients of my_serializer
to also be clients of ux
. Is that a reasonable thing for a crate developer to do? or is it considered bad practice?
The alternative would be to wrap this ux::u7
type inside my_serializer
, but then I'd need to reimplement all of the Trait implementations, of which there are hundreds! There isn't an easy way to macro-derive these for wrapped types, right?