I have a library that makes basic in-memory data layout called Packman. I have been using it for a while, and I really like it. Now I am doing a migration from two of its versions with breaking changes.
I have two types
VecPack<T>, where for<'de> T: Serialize, Deserialie<'de>, Clone, Debug, Default.
To use a
VecPack<T>, data must implement VecPackMember trait, which has one method
fn get_id(&self) -> Self::Out;
So now I have an old a new version of my Packman, and I have my stored data in fs in Packman files. I have a migration script, where I open the Packman file as
VecPack<T> via my old Packman, and then I create a new Packman
VecPack<T>, and store the same T data, but saving with the new VecPack format.
My data has the VecPackMember trait implemented, but thats the old Packman::VecPackMemeber trait, and the new
VecPack<T> says type T does not have the necessary VecPackMember implementation. Which is true, but the old and the new Packman VecPackMember are exactly the same.
So do you think there is any way to tell to the compiler, that my Type has a trait implementation and use that one as another trait implementation? As the to implementation would be exactly the same.
This way I would save couple of hours implementing unnecessary implementations.
Thank you in advance.