Skip to content

JsonSchemaResultsCollector.EnumerateResults Method

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: JsonSchemaResultsCollector.cs

EnumerateResults()

Enumerates validation results in collection order with efficient memory access patterns.

public JsonSchemaResultsCollector.ResultsEnumerator EnumerateResults()

Returns

JsonSchemaResultsCollector.ResultsEnumerator

A ResultsEnumerator that provides forward-only iteration over committed validation results. The enumerator is a value type optimized for minimal allocation overhead.

Remarks

Enumeration Characteristics: - Order: Results are returned in the order they were committed to the collector - Stability: Result order and content remain stable until collector disposal - Performance: O(1) per result access with minimal memory allocation - Thread Safety: Not thread-safe; do not enumerate concurrently with result collection Memory Access Pattern: The enumerator provides direct access to UTF-8 result data stored in internal buffers. Result strings are accessed as ReadOnlySpan for optimal performance, with helper methods available for string conversion when needed. Usage Guidelines: - Performance Critical: Use UTF-8 span accessors (e.g., Message) when possible - Convenience: Use string accessors (e.g., GetMessageText) for display purposes - Filtering: Check IsMatch early to optimize result processing

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue