-
Notifications
You must be signed in to change notification settings - Fork 333
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
Should Box<dyn ToSql>
be an instance of ToSql
?
#500
Comments
Returning a |
You sure? EDIT: Nevermind, of course a reference has a known size. I'm new at this. 😉 |
impl ToSql for Box<dyn ToSql>. Fixes #500
I had a function like
fn my_value_to_sql(v: &MyValue) -> Box<dyn ToSql>
which would parse aMyValue
into one of several different types, but all the types implementedToSql
. I had to returned thisBox
ed since otherwise the size of the return value wouldn't have been known.It would have been nice if
Box<dyn ToSql>
was an instance ofToSql
.(I'm fairly new to Rust, so it may be that my
Box
approach is misguided, but it's the best I could come up with.)The text was updated successfully, but these errors were encountered: