-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Decode
, Encode
and Type
for Box
, Arc
, Cow
and Rc
#3674
base: main
Are you sure you want to change the base?
Conversation
Decode
, Encode
and Type
for Box
, Arc
, Cow
and Rc
@joeydewaal technically it's still possible to use by getting the We can relax the sqlx/sqlx-core/src/query_as.rs Line 111 in 277dd36
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous comment.
676e11e
to
f2930a6
Compare
Makes sense, I added the impl for |
CI should be fixed if you rebase. |
9d694c0
to
b6521ae
Compare
impl<'r, DB, T> Decode<'r, DB> for $smart_pointer | ||
where | ||
DB: Database, | ||
T: Decode<'r, DB>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this may actually remove the impls for Box<str>
and Box<[u8]>
because of the implicit T: Sized
bound here.
where | ||
DB: Database, | ||
T: Decode<'r, DB>, | ||
T: ToOwned<Owned = T>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for Cow<'_, str>
fixes #3100
Implements
Decode
,Encode
andType
forBox<T>
,Arc<T>
,Cow<'_,T>
andRc<T>
. I left out theDecode
impl forRc<T>
because of theSend
trait bounds inQueryAs
andQueryScalar
(which makes it impossible to useRc
).