pub struct ElementMeta {
pub sequence: u64,
pub timestamp_ns: u64,
pub content_type: String,
}Expand description
Metadata accompanying each stream element.
Maps to the WIT element-meta record in torvyn:streaming@0.1.0
(Doc 01, Section 3.1). This is a plain data record — cheap to copy.
Per consolidated review (C01-4): the runtime (reactor’s flow driver)
assigns sequence and timestamp_ns before delivery. Component-provided
values are advisory and may be overwritten.
§Examples
use torvyn_types::ElementMeta;
let meta = ElementMeta {
sequence: 42,
timestamp_ns: 1_700_000_000_000_000_000,
content_type: "application/json".into(),
};
assert_eq!(meta.sequence, 42);Fields§
§sequence: u64Monotonic sequence number within this flow. Starts at 0 and increments by 1 for each element. The runtime guarantees uniqueness and ordering within a single flow.
timestamp_ns: u64Wall-clock timestamp in nanoseconds since Unix epoch. Set by the runtime when the element enters the pipeline.
content_type: StringContent type of the payload (e.g., “application/json”). Mirrors the buffer’s content-type for convenience; components can use this for dispatch without reading the buffer.
Implementations§
Trait Implementations§
Source§impl Clone for ElementMeta
impl Clone for ElementMeta
Source§fn clone(&self) -> ElementMeta
fn clone(&self) -> ElementMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more