You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks reasonable overall. The types were only intended to be used as helpers for implementing SerializeAs/DeserializeAs, but a small wrapper doesn't hurt. It does look similar to DeserializeAsWrap now.
I think it could cover the use case of SerializeAsWrap, but the type annotations might be a bit worse. In that case it might make sense to just have one wrapper and implement all the traits (serialization and deserialization) for it.
SerializeAsWrap
is a convenient adapter which provideSerialize
implementation overSerializeAs
.However,
SerializeAsWrap
only store the reference to the data, which makes it not able to return data wrapped with specificSerializeAs
impl.Given an example actix-web api:
The above code cannot be compiled since
SerializeAsWrap
doesn't owns the data.By adding an owned version of
SerializeAsWrap
can resolve the above issues:The text was updated successfully, but these errors were encountered: