pub struct Header {
pub stream_id: String,
pub timestamp: i64,
pub topic: String,
pub mime_type: String,
pub total_length: Option<u64>,
pub encryption_type: i32,
pub attributes: HashMap<String, String>,
pub inline_content: Option<Vec<u8>>,
pub compression: i32,
pub content_header: Option<ContentHeader>,
}Expand description
main DataStream.Header that contains a oneof for specific headers
Fields§
§stream_id: Stringunique identifier for this data stream
timestamp: i64using int64 for Unix timestamp
topic: String§mime_type: String§total_length: Option<u64>only populated for finite streams, if it’s a stream of unknown size this stays empty
encryption_type: i32this is set on the DataPacket
attributes: HashMap<String, String>user defined attributes map that can carry additional info
inline_content: Option<Vec<u8>>Optional inline content so that a data stream can be sent as a single packet for short payloads.
content as binary (bytes)
compression: i32§content_header: Option<ContentHeader>oneof to choose between specific header types
Implementations§
Source§impl Header
impl Header
Sourcepub fn total_length(&self) -> u64
pub fn total_length(&self) -> u64
Returns the value of total_length, or the default value if total_length is unset.
Sourcepub fn encryption_type(&self) -> Type
pub fn encryption_type(&self) -> Type
Returns the enum value of encryption_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_encryption_type(&mut self, value: Type)
pub fn set_encryption_type(&mut self, value: Type)
Sets encryption_type to the provided enum value.
Sourcepub fn inline_content(&self) -> &[u8] ⓘ
pub fn inline_content(&self) -> &[u8] ⓘ
Returns the value of inline_content, or the default value if inline_content is unset.
Sourcepub fn compression(&self) -> CompressionType
pub fn compression(&self) -> CompressionType
Returns the enum value of compression, or the default if the field is set to an invalid enum value.
Sourcepub fn set_compression(&mut self, value: CompressionType)
pub fn set_compression(&mut self, value: CompressionType)
Sets compression to the provided enum value.
Trait Implementations§
§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Message for Header
impl Message for Header
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.