pub struct SegmentInfo {
pub sequence: u64,
pub duration_ms: Option<u64>,
pub stream_id: Option<String>,
pub continues: Option<bool>,
pub extra: Vec<(Value, Value)>,
}Expand description
Per-segment metadata.
Present only in segmented traces. A single-shot file must not carry it — its absence is what tells a reader that event sequence numbers and timestamps are file-global rather than segment-local.
Fields§
§sequence: u640-based sequence number of this segment within the stream.
duration_ms: Option<u64>Nominal segment duration in milliseconds. A hint; the actual duration may differ.
stream_id: Option<String>Opaque identifier shared by every segment of the same logical stream.
continues: Option<bool>true if this segment continues a previous one with the same
stream_id. false or absent for the first segment.
extra: Vec<(Value, Value)>Keys in the "segment" map that this version of the crate could not
use, kept verbatim and written back into that map.
The store belongs to "segment" and not to the header: a private key
on the segment and a key of the same name at the top level are
different keys, and re-emitting either in the other’s map changes what
the file says. See TraceHeader::extra.
Empty for every segment this crate constructs itself.
Implementations§
Source§impl SegmentInfo
impl SegmentInfo
Sourcefn writes_key(&self, key: &str) -> bool
fn writes_key(&self, key: &str) -> bool
Whether key is written from one of this map’s own fields —
equivalently, on a segment that was decoded, whether the decode used
it. See TraceHeader::writes_key for why the destructuring is
exhaustive and why this is not “does the format define key”.
fn to_value(&self) -> Value
Sourcefn from_pairs(pairs: &[(Value, Value)]) -> Result<Self, MoqTraceError>
fn from_pairs(pairs: &[(Value, Value)]) -> Result<Self, MoqTraceError>
Decode the contents of a "segment" map.
The caller has already established that the value is a map: a
"segment" that is not one is an unusable optional value on the
header, and goes to the header’s store rather than failing the file.
Trait Implementations§
Source§impl Clone for SegmentInfo
impl Clone for SegmentInfo
Source§fn clone(&self) -> SegmentInfo
fn clone(&self) -> SegmentInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more