What would be the idiomatic way to break the get_post_info
functions up so that they're not duplicating most of their code?
have a function that returns partially filtered output, so that other methods can apply additional conditions and retrieve results.
What data type would the function need to return, though? I can't just return a Vec<PostInfo>
; I need to use the database index to look up a few posts out of potentially hundreds of thousands. Probably I would want to return an impl Trait
of some sort, but I couldn't find anything in the guide that says what trait I would use.
Hm, good question. Perhaps ask here: diesel-rs/diesel - Gitter
I've got to diesel::query_builder::SelectStatement,
but that's not the whole answer.
You might find this article interesting
http://diesel.rs/guides/composing-applications/
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.