Skip to main content

SegmentInfo

Struct SegmentInfo 

Source
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: u64

0-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

Source

pub fn new(sequence: u64) -> Self

A segment carrying only its sequence number.

Source

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”.

Source

fn to_value(&self) -> Value

Source

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

Source§

fn clone(&self) -> SegmentInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SegmentInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SegmentInfo

Source§

fn eq(&self, other: &SegmentInfo) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SegmentInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.