pub struct Frame {
pub kind: FrameKind,
pub topic: String,
pub timestamp_ns: u64,
pub correlation_id: u64,
pub payload: Vec<u8>,
pub content_hash: Option<[u8; 32]>,
}Expand description
A side-channel frame.
Frames are auditable (Zero-Principle Pillar 6 zero-context-loss):
content_hash is SHA-256 over (kind, topic, timestamp_ns, correlation_id, payload). Phase-1: the hash field is optional and
defaults to None; in Phase-2 the hash is set during server-side
dispatch.
Fields§
§kind: FrameKindWhich layer emitted the frame.
topic: StringTopic name (or empty when a transport layer without a TypeObject).
timestamp_ns: u64Wall-clock timestamp in nanoseconds since the UNIX epoch.
correlation_id: u64Sequence number / sample-identity GUID prefix for cross- layer correlation (R-077).
payload: Vec<u8>Sample payload as bytes (layer-specific encoding).
content_hash: Option<[u8; 32]>Optional content hash (Zero-Principle Foundation 2). Set
by the server when audit streams are active. Phase-1
defaults to None.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn dcps(
topic: String,
timestamp_ns: u64,
correlation_id: u64,
payload: Vec<u8>,
) -> Self
pub fn dcps( topic: String, timestamp_ns: u64, correlation_id: u64, payload: Vec<u8>, ) -> Self
Creates a DCPS frame.
Sourcepub fn rtps(
topic: String,
timestamp_ns: u64,
correlation_id: u64,
payload: Vec<u8>,
) -> Self
pub fn rtps( topic: String, timestamp_ns: u64, correlation_id: u64, payload: Vec<u8>, ) -> Self
Creates an RTPS frame.
Sourcepub fn transport(
timestamp_ns: u64,
correlation_id: u64,
payload: Vec<u8>,
) -> Self
pub fn transport( timestamp_ns: u64, correlation_id: u64, payload: Vec<u8>, ) -> Self
Creates a transport frame.
Sourcepub fn with_content_hash(self) -> Self
pub fn with_content_hash(self) -> Self
Computes the content hash and stores it.
Hash input: kind tag + topic + timestamp_ns + correlation_id + payload. Idempotent — repeated calls change nothing as long as the content stays the same.
Sourcepub fn verify_content_hash(&self) -> bool
pub fn verify_content_hash(&self) -> bool
Verifies that the stored hash matches the one computed from the current frame content.