pub struct MeasurementReportInput { /* private fields */ }Expand description
Typed read-side subset accepted when a consumer needs measurements from a
current measure or lint report.
This intentionally models only the fields needed to recover the nested
measurement contract while retaining every legitimate output-v10 root
field. The frozen schema is closed, while all protocol identities and
command constraints are validated by MeasurementReportInput::into_files.
Implementations§
Source§impl MeasurementReportInput
impl MeasurementReportInput
Sourcepub fn read_from(reader: impl Read) -> Result<Self, MeasurementReportReadError>
pub fn read_from(reader: impl Read) -> Result<Self, MeasurementReportReadError>
Read one report through the immutable output-v10 byte bound before UTF-8 or JSON parsing.
The JSON parser receives at most OUTPUT_V10_MAX_REPORT_BYTES bytes
and retains its recursion limit. This function never performs an
unbounded read_to_end or constructs a generic JSON value.
§Errors
Returns a typed I/O, N+1 size, or JSON-shape error. Semantic contract
validation remains in Self::into_files.
Sourcepub fn file_count(&self) -> Option<usize>
pub fn file_count(&self) -> Option<usize>
Number of file records present before nested record validation.
Returns None when the report omitted its file array. Consumers can
retain this count while MeasurementReportInput::into_files performs
full validation, then apply their own cardinality and error policy.
Sourcepub fn into_files(
self,
) -> Result<Vec<MeasurementReportFile>, MeasurementReportError>
pub fn into_files( self, ) -> Result<Vec<MeasurementReportFile>, MeasurementReportError>
Validate current output/measurement identities and recover every file’s
complete measurement record from a measure or lint report.
File order is preserved. Empty and multi-file reports are accepted so callers can apply their own cardinality policy.
§Errors
Returns a typed error for a missing or unsupported identity, command, file shape, nested measurement contract, or measurement payload.