pub struct DataChunk {
pub stream_id: String,
pub sequence: u64,
pub payload: Bytes,
pub metadata: Vec<MetadataEntry>,
pub timestamp_ms: Option<i64>,
}Expand description
DataChunk - A single chunk of an application data stream (Fast Path)
For streaming application data (non-media):
- File transfer chunks
- Game state updates
- Custom protocol streams
Fields§
§stream_id: String§sequence: u64§payload: Bytes§metadata: Vec<MetadataEntry>§timestamp_ms: Option<i64>Producer-defined data time for the chunk’s content (sampling instant,
simulation tick, authoring time — the producing application chooses
the clock and the meaning). Purely an application annotation: the
runtime never reads it, ordering is carried by sequence alone, it
is not a freshness or timeout input, and receivers must not compare
it against their local clocks.
Deliberately the only application-semantic annotation promoted to a
dedicated field: time is the overwhelmingly common stream annotation,
and a typed slot keeps every SDK on one name and one type instead of
per-app string conventions. Not a precedent — any other application
annotation belongs in metadata.
Implementations§
Trait Implementations§
Source§impl Message for DataChunk
impl Message for DataChunk
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.