Replies: 2 comments 1 reply
-
I ended up using traits, but I don't like the fact that the type is extremely broad and to avoid this broadness I'd have to create a redundant struct again... pub trait DatabaseUtils {
fn app_db(&self) -> mongodb::Database;
fn users_coll(&self) -> mongodb::Collection<User>;
}
impl DatabaseUtils for mongodb::Client { |
Beta Was this translation helpful? Give feedback.
0 replies
-
Did you try this: https://api.rocket.rs/v0.5-rc/rocket_db_pools/struct.Connection.html#example ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a function
which I call in a fairing like so:
But I also want to call the function in this route
The error I get is:
======================
I ended up using traits, but I don't like the fact that the type is extremely broad and to avoid this broadness I'd have to create a redundant struct again...
Beta Was this translation helpful? Give feedback.
All reactions