Replies: 1 comment
-
|
There is really not much more that diesel can offer here, as this is a language restriction. There is no other solution to write impls that would be otherwise forbidden due to the orphan rule than using a new type wrapper. If you believe you know an other solution please write a RFC so that the language gets changed. I do not have another solution + writing RFC's is clearly out of scope for our work diesel itself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Due to Rust's coherence rules, given trait T and data type D, one can't
impl T for Din a crate C unless at least one of T or D is defined in C. So apparently it's impossible to implement ToSql, FromSql, Queryable traits for data types outside of one's project crate. But is this possible in some other way, such as with adeserialize_asorserialize_asattribute?Thus far, I've been writing ugly wrapper types so that I can have implementations of the Diesel traits for external types. It seems like there's gotta be a better way though.
Beta Was this translation helpful? Give feedback.
All reactions