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
The Encode, Decode and Type traits are already implemented for various types, including the clone-on-write Cow smart pointer - is there any objection to providing an impl for Arc<str> too?
Our use case is for storing/fetching new-type'd wrappers over ref-counted strings, such as:
pubstructPartitionKey(Arc<str>);
Where this type is wrote to / fetched from Postgres.
We Arc the underlying str to minimise memory usage (this particular string can have large ref counts). Currently we impl the encode / decode / type traits ourselves (as VARCHAR) and delegate serialisation to the existing str impls.
This should generally be implemented for all types T: Encode etc. Encode, Decode, and Type, should be implemented on the unsized types str and [T] and that would fix some of the problems I've run into lately.
The
Encode
,Decode
andType
traits are already implemented for various types, including the clone-on-writeCow
smart pointer - is there any objection to providing an impl forArc<str>
too?Our use case is for storing/fetching new-type'd wrappers over ref-counted strings, such as:
Where this type is wrote to / fetched from Postgres.
We
Arc
the underlyingstr
to minimise memory usage (this particular string can have large ref counts). Currently we impl the encode / decode / type traits ourselves (asVARCHAR
) and delegate serialisation to the existingstr
impls.Ideally we'd like this to work:
I'm happy to open a PR for this if it is desired 👍
The text was updated successfully, but these errors were encountered: