fn next(&mut self) -> Option<Self::Item> {
        /*
         * Run a "hidden iterator" internally, over every possible sample resource. Stop when we find a
         * match or exhaust the samples.
         */
        let mut next_resource_unfiltered = self
            .next_resource_unfiltered()
            .expect("Unable to get next sample resource.");
        while next_resource_unfiltered.is_some() {
            // Don't return any duplicates.
            let source_id = &next_resource_unfiltered
                .as_ref()
                .unwrap()
                .metadata
                .source_id;
            if !self.source_ids.contains(source_id) {
                self.source_ids.insert(source_id.clone());

                // Stop popping resources if/when we find a match.
                if self.resource_type
                    == next_resource_unfiltered
                        .as_ref()
                        .unwrap()
                        .metadata
                        .resource_type
                {
                    trace!("Found matching resource type.");
                    break;
                }
            }

            next_resource_unfiltered = self
                .next_resource_unfiltered()
                .expect("Unable to get next sample resource.");
        }

        // At this point, we either found a match or exhausted the samples.
        next_resource_unfiltered
    }
/// Retuns the next matching JSON resource found, if any.
Retuns the next matching JSON resource found, if any.
Retuns the next matching JSON resource found if any .
fn next(&mut self) -> Option<Self::Item> {
        /*
         * Run a "hidden iterator" internally, over every possible sample resource. Stop when we find a
         * match or exhaust the samples.
         */
        let mut next_resource_unfiltered = self
            .next_resource_unfiltered()
            .expect("Unable to get next sample resource.");
        while next_resource_unfiltered.is_some() {
            // Don't return any duplicates.
            let source_id = &next_resource_unfiltered
                .as_ref()
                .unwrap()
                .metadata
                .source_id;
            if !self.source_ids.contains(source_id) {
                self.source_ids.insert(source_id.clone());
                // Stop popping resources if/when we find a match.
                if self.resource_type
                    == next_resource_unfiltered
                        .as_ref()
                        .unwrap()
                        .metadata
                        .resource_type
                {
                    trace!("Found matching resource type.");
                    break;
                }
            }
            next_resource_unfiltered = self
                .next_resource_unfiltered()
                .expect("Unable to get next sample resource.");
        }
        // At this point, we either found a match or exhausted the samples.
        next_resource_unfiltered
    }
fn next ( & mut self ) -> Option < Self :: Item > { /*
         * Run a "hidden iterator" internally, over every possible sample resource. Stop when we find a
         * match or exhaust the samples.
         */ let mut next_resource_unfiltered = self . next_resource_unfiltered ( ) . expect ( " " ) ; while next_resource_unfiltered . is_some ( ) { // Don't return any duplicates. let source_id = & next_resource_unfiltered . as_ref ( ) . unwrap ( ) . metadata . source_id ; if ! self . source_ids . contains ( source_id ) { self . source_ids . insert ( source_id . clone ( ) ) ; // Stop popping resources if/when we find a match. if self . resource_type == next_resource_unfiltered . as_ref ( ) . unwrap ( ) . metadata . resource_type { trace ! ( " " ) ; break ; } } next_resource_unfiltered = self . next_resource_unfiltered ( ) . expect ( " " ) ; } // At this point, we either found a match or exhausted the samples. next_resource_unfiltered }
Retuns the next matching JSON resource found, if any.
Retuns the next matching JSON resource found if any .
&mut self
&mut self