/// Run the poller for this ElementQuery and return the Vec of WebElements matched.
/// NOTE: This function doesn't return a no_such_element error and the caller must handle it.
Run the poller for this ElementQuery and return the Vec of WebElements matched.
NOTE: This function doesn't return a no_such_element error and the caller must handle it.
Run the poller for this ElementQuery and return the Vec of WebElements matched . NOTE : This function doesn ' t return a no_such_element error and the caller must handle it .
async fn run_poller(&self, inverted: bool) -> WebDriverResult<Vec<WebElement<'a>>> {
        let no_such_element_error = no_such_element(&self.selectors, &self.description);
        if self.selectors.is_empty() {
            return Err(no_such_element_error);
        }
        let mut ticker = ElementPollerTicker::new(self.poller.clone());
        let check = |value: bool| {
            if inverted {
                !value
            } else {
                value
            }
        };
        loop {
            for selector in &self.selectors {
                let mut elements = match self.fetch_elements_from_source(selector).await {
                    Ok(x) => x,
                    Err(WebDriverError::NoSuchElement(_)) => Vec::new(),
                    Err(e) => return Err(e),
                };
                if !elements.is_empty() {
                    elements = selector.run_filters(elements).await?;
                }
                if check(!elements.is_empty()) {
                    return Ok(elements);
                }
            }
            if !ticker.tick().await {
                return Ok(Vec::new());
            }
        }
    }
async fn run_poller ( & self , inverted : bool ) -> WebDriverResult < Vec < WebElement < ' a > > > { let no_such_element_error = no_such_element ( & self . selectors , & self . description ) ; if self . selectors . is_empty ( ) { return Err ( no_such_element_error ) ; } let mut ticker = ElementPollerTicker :: new ( self . poller . clone ( ) ) ; let check = | value : bool | { if inverted { ! value } else { value } } ; loop { for selector in & self . selectors { let mut elements = match self . fetch_elements_from_source ( selector ) . await { Ok ( x ) => x , Err ( WebDriverError :: NoSuchElement ( _ ) ) => Vec :: new ( ) , Err ( e ) => return Err ( e ) , } ; if ! elements . is_empty ( ) { elements = selector . run_filters ( elements ) . await ? ; } if check ( ! elements . is_empty ( ) ) { return Ok ( elements ) ; } } if ! ticker . tick ( ) . await { return Ok ( Vec :: new ( ) ) ; } } }
Run the poller for this ElementQuery and return the Vec of WebElements matched.
Run the poller for this ElementQuery and return the Vec of WebElements matched .
&self
inverted
bool