Skip to content

method filter exists for struct schema::dsl::tb_net_worth, but its trait bounds were not satisfied #2985

Answered by weiznich
linrongbin16 asked this question in Q&A
Discussion options

You must be logged in to vote

As the compiler is already telling you: Your code is missing imports for any required traits.

The corresponding compiler error message:

    = help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
     |
3    | use std::iter::Iterator;
     |
3    | use crate::diesel::query_dsl::filter_dsl::FilterDsl;
     |
3    | use crate::diesel::QueryDsl;
     |
3    | use log4rs::filter::Filter;

The API documentation indicates that you want to import QueryDsl in this case.

(For the other errors a similar message is emitted.)

You can simplify the diesel related import statements by just addin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@linrongbin16
Comment options

Answer selected by linrongbin16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants