[−][src]Trait rdkafka::message::Headers
Message headers trait
A trait to represent readable message headers. Headers are key-value pairs that can be sent alongside every message. Only read-only methods are provided by this trait, as the underlying storage might not allow modification.
Required methods
fn count(&self) -> usize
Return the number of defined headers.
fn get(&self, idx: usize) -> Option<(&str, &[u8])>
Get the specified header (the first header corresponds to index 0). If the index is out of bounds, None is returned.
Provided methods
fn get_as<V: FromBytes + ?Sized>(
&self,
idx: usize
) -> Option<(&str, Result<&V, V::Error>)>
&self,
idx: usize
) -> Option<(&str, Result<&V, V::Error>)>
Same as Headers::get, but the value of the header will be converted to the specified type. If the conversion fails, an error will be returned instead.
Implementors
impl Headers for BorrowedHeaders
[src]
fn count(&self) -> usize
[src]
fn get(&self, idx: usize) -> Option<(&str, &[u8])>
[src]
fn get_as<V: FromBytes + ?Sized>(
&self,
idx: usize
) -> Option<(&str, Result<&V, V::Error>)>
[src]
&self,
idx: usize
) -> Option<(&str, Result<&V, V::Error>)>