Struct rdkafka::message::OwnedHeaders [−][src]
A collection of Kafka message headers that owns its backing data.
Kafka supports associating an array of key-value pairs to every message,
called message headers. The OwnedHeaders
can be used to create the desired
headers and to pass them to the producer. See also BorrowedHeaders
.
Implementations
impl OwnedHeaders
[src]
pub fn new() -> OwnedHeaders
[src]
Creates a new OwnedHeaders
struct with initial capacity 5.
pub fn new_with_capacity(initial_capacity: usize) -> OwnedHeaders
[src]
Creates a new OwnedHeaders
struct with the desired initial capacity.
The structure is automatically resized as more headers are added.
pub fn add<V: ToBytes + ?Sized>(self, name: &str, value: &V) -> OwnedHeaders
[src]
Adds a new header.
pub fn as_borrowed(&self) -> &BorrowedHeaders
[src]
Generates a read-only BorrowedHeaders
reference.
Trait Implementations
impl Clone for OwnedHeaders
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for OwnedHeaders
[src]
impl Default for OwnedHeaders
[src]
fn default() -> OwnedHeaders
[src]
impl Headers for OwnedHeaders
[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>)>
impl Send for OwnedHeaders
[src]
impl Sync for OwnedHeaders
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,