Skip to main content

RawSeriesStream

Trait RawSeriesStream 

Source
pub trait RawSeriesStream: Stream<Item = Result<RawSeriesChunk, BoxedError>> + Send {
    // Required methods
    fn schema(&self) -> &Arc<SeriesSchema> ⓘ;
    fn label_source(&self) -> &RawLabelSource;
    fn ordering(&self) -> SeriesOrdering;

    // Provided method
    fn label_decode_spec(&self) -> Option<&LabelDecodeSpec> { ... }
}
Expand description

A stream of raw series chunks with stable schema, label binding, and ordering.

Every series has strictly increasing timestamps within and across chunks; timestamps are unique per series. Interleaved permits a series to resume after another series; Contiguous and KeyThenTime guarantee each series’ chunks are contiguous. KeyThenTime uses the complete stream identity compatible with its label binding, not just a TSID or hash. These are per-stream guarantees, not query-global order, partition ownership, or finality. is_last marks the last chunk of that series in this stream only; merging requires recomputing per-input-series finalization across all related inputs, not aggregate-group finality. Label interpretation is carried by the stream: RawSeriesStream::label_source states the scan-bound identity a producer read under, and RawSeriesStream::label_decode_spec states the label layout the stream’s own chunks declare. Stream finality applies to all related input series, not aggregate groups or vector-match state.

Required Methods§

Source

fn schema(&self) -> &Arc<SeriesSchema> ⓘ

Returns the schema shared by all chunks; raw schemas have no evaluation grid.

Source

fn label_source(&self) -> &RawLabelSource

Returns scan-bound label metadata. The binding does not dictate representation: chunks with a decode specification leave metric as None; otherwise they supply the complete explicit label set. The metric name itself may be absent.

A stream that was decoded from a raw frame has no scan-bound identity and reports NO_BOUND_LABEL_SOURCE, which reads as Explicit while its chunks may still carry no labels at all. That value therefore answers “is this the region I read under”, never “are these labels complete”: Self::label_decode_spec is the stream’s statement about its encoding, and every consumer that decides whether to decode reads that instead.

Source

fn ordering(&self) -> SeriesOrdering

Returns this stream’s ordering guarantee.

Provided Methods§

Source

fn label_decode_spec(&self) -> Option<&LabelDecodeSpec>

Returns the label decode description this stream declares for key-encoded labels.

Every stream whose chunks carry key-encoded labels declares the description here, whether it is a storage producer or a stream reassembled from a raw frame. A consumer holding only that description can therefore decode labels without a scan-bound RawLabelSource: the description, not the binding, describes the encoding, and a receiver reporting NO_BOUND_LABEL_SOURCE still states through this description that its chunks are undecoded key chunks. A stream that carries complete labels instead answers None. This is the description the stream declares, not an authenticated statement about where the values came from.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§