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 content_header: Option<ContentHeader>,
}
Expand description
main DataStream.Header that contains a oneof for specific headers
Fields§
§stream_id: String
unique identifier for this data stream
timestamp: i64
using 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: i32
defaults to NONE
attributes: HashMap<String, String>
user defined attributes map that can carry additional info
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.
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for Header
impl Message for Header
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
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,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
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>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
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
Mutably borrows from an owned value. Read more