Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide a `FromSql` impl for `*const str` and `*const [u8]` #1365
Comments
sgrif
added this to the 1.1 milestone
Dec 9, 2017
added a commit
that referenced
this issue
Jan 7, 2018
sgrif
referenced this issue
Jan 7, 2018
Merged
Provide `FromSql` impls for `*const str` and `*const [u8]` #1458
added a commit
that referenced
this issue
Jan 13, 2018
added a commit
that referenced
this issue
Jan 13, 2018
added a commit
that referenced
this issue
Jan 13, 2018
added a commit
that referenced
this issue
Jan 15, 2018
added a commit
that referenced
this issue
Jan 15, 2018
added a commit
that referenced
this issue
Jan 15, 2018
sgrif
closed this
in
#1458
Jan 15, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sgrif commentedDec 9, 2017
There are various impls that compose on the
FromSqlimpls forStringandVec<u8>, but do not need an owned string/vec. We cannot safely provide an impl for&str, or&[u8]. The only safe impl we could provide would be one where the return value lasts as long as the argument tofrom_sql. This would only ever be useful for composed implementations, but providing that safe impl would require restructuringFromSqlto have a lifetime attached, which I really don't want to do.Though we can't represent the lifetime of this reference with the current structure of
FromSql, we can absolutely provide an impl for raw pointers, documenting how long they last.