Hi, I have a custom wrapper type that, in terms of encoding/decoding, should behave exactly as its underlying type:
I'm able to implement Encode/Decode successfully, nevertheless, if this type is used as follows:
struct Foo {
#[codec(compact)]
a: MyWrapper<u64>,
}
The compile throws an error. Basically, it requires that CompactRef<'a, MyWrapper<u64>> implements Encode/Decode. But I can not do that because both CompactRef and Encode/Decode are foreign to my crate. I can neither implement HasCompact directly because it's already implemented for T in the library, and to fulfill the conditions, I need the CompactRef implementation.
Is any way to create compactables custom types?
Hi, I have a custom wrapper type that, in terms of encoding/decoding, should behave exactly as its underlying type:
I'm able to implement
Encode/Decodesuccessfully, nevertheless, if this type is used as follows:The compile throws an error. Basically, it requires that
CompactRef<'a, MyWrapper<u64>>implementsEncode/Decode. But I can not do that because bothCompactRefandEncode/Decodeare foreign to my crate. I can neither implementHasCompactdirectly because it's already implemented forTin the library, and to fulfill the conditions, I need theCompactRefimplementation.Is any way to create compactables custom types?