pub struct MergeRecordDecoder<D> { /* private fields */ }Expand description
Merges the record decoding streams from one or more other decoders, performing a
k-merge based on Record::index_ts().
Implementations§
Source§impl<D> RecordDecoder<D>where
D: DecodeRecordRef,
impl<D> RecordDecoder<D>where
D: DecodeRecordRef,
Sourcepub fn new(decoders: Vec<D>) -> Result<Self>
pub fn new(decoders: Vec<D>) -> Result<Self>
Creates a new record-stream merging decoder.
§Errors
This function returns an error if decoders is empty. It will also return an
error if one of the inner decoders returns an error while decoding the first
record. A decoder returning Ok(None) does not result in a failure.
Sourcepub fn with_hints(decoders: Vec<D>, start_ts_hints: Vec<u64>) -> Result<Self>
pub fn with_hints(decoders: Vec<D>, start_ts_hints: Vec<u64>) -> Result<Self>
Creates a new record-stream merging decoder with a hint for the start time for each decoder. This can assist the merger to avoid reading from a decoder before necessary.
The hint timestamp must be <= raw_index_ts() of the first record in the file.
Metadata::start is an example source of for hint.
§Errors
This function returns an error if decoders is empty or decoders and
start_ts_hints are of different lengths. It will also return an error if
one of the inner decoders returns an error while decoding the first record. A
decoder returning Ok(None) does not result in a failure.
Trait Implementations§
Source§impl<D> DecodeRecord for RecordDecoder<D>where
D: LastRecord + DecodeRecordRef,
impl<D> DecodeRecord for RecordDecoder<D>where
D: LastRecord + DecodeRecordRef,
Source§impl<D> DecodeRecordRef for RecordDecoder<D>where
D: LastRecord + DecodeRecordRef,
impl<D> DecodeRecordRef for RecordDecoder<D>where
D: LastRecord + DecodeRecordRef,
Source§impl<D> DecodeStream for RecordDecoder<D>where
D: LastRecord + DecodeRecordRef,
impl<D> DecodeStream for RecordDecoder<D>where
D: LastRecord + DecodeRecordRef,
Source§fn decode_stream<T: HasRType>(self) -> StreamIterDecoder<Self, T>where
Self: Sized,
fn decode_stream<T: HasRType>(self) -> StreamIterDecoder<Self, T>where
Self: Sized,
T. This
lazily decodes the data.