Hi, I have this struct with HTML "selectors" in it.
pub struct SelectAll {
result: &'static dyn Predicate,
title: &'static dyn Predicate,
summary: &'static dyn Predicate,
url: (&'static dyn Predicate, UrlLocation),
}
Those are predicates from the select HTML parsing crate. (select::predicate - Rust)
However, when I try to use it with the find function I get this weird error that I don't understand. (select::document::Document - Rust)
error[E0277]: expected a `std::ops::Fn<(&select::node::Node<'_>,)>` closure, found `dyn select::predicate::Predicate`
--> src/rover/all/executor/method/select.rs:30:19
|
30 | for result in document.find(predicates.result) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<(&select::node::Node<'_>,)>` closure, found `dyn select::predicate::Predicate`
|
= help: the trait `std::ops::Fn<(&select::node::Node<'_>,)>` is not implemented for `dyn select::predicate::Predicate`
= note: required because of the requirements on the impl of `std::ops::FnOnce<(&select::node::Node<'_>,)>` for `&dyn select::predicate::Predicate`
= note: required because of the requirements on the impl of `select::predicate::Predicate` for `&dyn select::predicate::Predicate`
= note: required because of the requirements on the impl of `std::iter::Iterator` for `select::document::Find<'_, &dyn select::predicate::Predicate>`
Do you have any idea how to do this?