pub struct SampleRow {Show 21 fields
pub key: String,
pub origin: Option<String>,
pub subject: Option<String>,
pub t: Option<u64>,
pub type_name: Option<String>,
pub typed: Option<bool>,
pub encoding: Option<String>,
pub timestamp: Option<String>,
pub qos: Option<String>,
pub qos_axes: Option<String>,
pub delete: bool,
pub bytes: Option<String>,
pub value: Option<Value>,
pub payload_bytes: Option<usize>,
pub source: Option<String>,
pub attachment: Option<Value>,
pub attachment_b64: Option<String>,
pub attachment_bytes: Option<usize>,
pub verdict: Option<String>,
pub violations: Option<Vec<String>>,
pub decode_error: Option<String>,
}Expand description
One sample, as the explorers write it (#235).
The write side of this module’s dialect: .zrec rows (RFC 09 §5.2),
zenctl echo --format ndjson, and zengui’s echo export are all
this struct, so parse_row reads back what any of them wrote. Every
optional field is skip_serializing_if: a writer that does not hold a
fact omits it rather than nulling it, because a null here would claim
a question was asked and answered negatively (RFC 09 §5.1 O4). That is
also what keeps the three writers’ rows a subset relationship rather
than three shapes — a .zrec row carries no origin, an echo row
carries no pacing offset, and neither is lying about the other.
Fields§
§key: StringFull wire key, as received — explorers run un-namespaced (RFC 09 §5).
origin: Option<String>The convention-parsed origin chunk, when the key parses at all.
Absent means the key did not parse under the observer’s base, which is a fact about the key and not a claim about the fleet (O1/O3).
subject: Option<String>The parsed subject tail, joined — absent on the same terms as
SampleRow::origin.
t: Option<u64>Microseconds since the capture epoch: the observer’s arrival clock, and the only thing replay paces by (RFC 09 §5.2). A live stream has no epoch to be relative to, so it omits this.
type_name: Option<String>The registry-declared type name, when a decode was asked for and
resolved one. --no-decode never asks, so it omits this rather than
nulling it (O4).
typed: Option<bool>Whether SampleRow::value is a schema decode rather than a
structural rendering. Absent when nothing was decoded.
encoding: Option<String>The sample’s declared encoding, verbatim (RFC 08 §7: sample beats registry beats sniff).
timestamp: Option<String>The sample’s HLC, when one rode it. Whose clock it is depends on who stamped it (RFC 09 §5.1 O7); this field says only that it exists.
qos: Option<String>The RFC 04 §3 QoS profile name, and only when the wire’s actual axes match one.
This is the field parse_row resolves through
zenkey::qos::QosProfile::from_name, so it must never carry
anything else — axes matching no profile are not approximated, they
ride SampleRow::qos_axes instead. Writing the axes here is
exactly the bug in #235.
qos_axes: Option<String>The wire’s actual QoS axes as one token,
priority/congestion/reliability[+express] (#120).
A fact worth carrying and not a profile name: a fleet is free to publish axes no profile declares, and the declared-vs-observed comparison is the point.
delete: boolA tombstone: authoritative retirement, never an empty put (RFC 04 §1.2). Always written — every sample is one or the other, and that is a fact rather than an unanswered question.
bytes: Option<String>Base64 of the exact wire payload — lossless and round-trippable,
which is why parse_row prefers it over SampleRow::value.
value: Option<Value>The payload as a rendering: a schema decode when one was asked for and succeeded, else the structural degradation. It does not round-trip a binary payload, and RFC 09 §5.2 says so.
payload_bytes: Option<usize>True payload size, whatever the rendering above shows.
Deliberately not spelled bytes: that key has meant the base64
payload since RFC 09 §5.2, and a byte count under it makes the row
unreadable rather than merely lossy (#235).
source: Option<String>The publishing entity, zid:eid#sn, when SourceInfo rode the
sample. Usually absent: zenoh 1.9 and 1.10 deliver none to a
subscriber — 1.10 even dropped setting it through the advanced API
(eclipse-zenoh/zenoh#2563) — RFC 09 §5.1 O7’s practical note.
attachment: Option<Value>The attachment as a rendering (#117), on the same terms as
SampleRow::value.
attachment_b64: Option<String>Base64 of the exact attachment bytes; wins over the rendering.
attachment_bytes: Option<usize>True attachment size, whatever the rendering above shows.
verdict: Option<String>The RFC 08 §7 validation verdict, present only when the pipeline was asked — and then always, so “valid” and “not checked” cannot be confused by a shared absence (#159).
violations: Option<Vec<String>>The failed constraints, when the verdict is invalid.
decode_error: Option<String>Why a decode that was asked for did not happen.
Implementations§
Source§impl SampleRow
impl SampleRow
Sourcepub fn of_key(key: &str, base: &str) -> SampleRow
pub fn of_key(key: &str, base: &str) -> SampleRow
The identity fields every writer shares: the wire key, and what the convention could make of it under this base.
A key that does not parse still yields a row — O1: a key that does
not parse is a fact, not an error — it simply carries no origin
or subject.
Sourcepub fn with_wire(self, view: &SampleView) -> SampleRow
pub fn with_wire(self, view: &SampleView) -> SampleRow
The wire facts a crate::SampleView carries, filled in.
Payload and attachment are left to the caller: an observer renders
them (value), a capture stores them (bytes), and which one a
writer owes is the difference between the two dialect halves.
Sourcepub fn with_payload_bytes(self, payload: &[u8]) -> SampleRow
pub fn with_payload_bytes(self, payload: &[u8]) -> SampleRow
The lossless payload, base64 — what a capture owes and a live rendering does not (RFC 09 §5.2).
Trait Implementations§
impl StructuralPartialEq for SampleRow
Auto Trait Implementations§
impl Freeze for SampleRow
impl RefUnwindSafe for SampleRow
impl Send for SampleRow
impl Sync for SampleRow
impl Unpin for SampleRow
impl UnsafeUnpin for SampleRow
impl UnwindSafe for SampleRow
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more