ValidatedSet
This trait defines a contract for iterating over a set of validated inputs. It provides a mechanism to process items that implement the BorrowInput trait by passing them to a consumer, returning the result of the iteration or a validation error.
Methods
iterate()
def iterate(
consumer: impl ConsumeIterator< PyResult< Self::Item >, Output = R >
) - > ValResult< R >
Iterates over the validated set and applies a consumer to each item. This method is used to process validated inputs while handling potential validation errors during the iteration process.
Parameters
| Name | Type | Description |
|---|---|---|
| consumer | impl ConsumeIterator< PyResult< Self::Item >, Output = R > | An iterator consumer that processes each validated item or handles a Python result error for each element in the set. |
Returns
| Type | Description |
|---|---|
ValResult< R > | The result of the consumer's processing, wrapped in a validation result that may contain errors encountered during iteration. |