fn estimate_message_size<H>(
    payload: Option<&[u8]>,
    key: Option<&[u8]>,
    headers: Option<&H>,
) -> usize
where
    H: Headers,
{
    payload.map(|payload| payload.len()).unwrap_or_default()
        + key.map(|key| key.len()).unwrap_or_default()
        + header_iter(headers)
            .map(|(key, value)| key.len() + value.len())
            .sum::<usize>()
}
/// Estimate size of data read from kafka as payload len + key len + headers
Estimate size of data read from kafka as payload len + key len + headers
Estimate size of data read from kafka as payload len + key len + headers
fn estimate_message_size<H>(
    payload: Option<&[u8]>,
    key: Option<&[u8]>,
    headers: Option<&H>,
) -> usize
where
    H: Headers,
{
    payload.map(|payload| payload.len()).unwrap_or_default()
        + key.map(|key| key.len()).unwrap_or_default()
        + header_iter(headers)
            .map(|(key, value)| key.len() + value.len())
            .sum::<usize>()
}
fn estimate_message_size < H > ( payload : Option < & [ u8 ] > , key : Option < & [ u8 ] > , headers : Option < & H > , ) -> usize where H : Headers , { payload . map ( | payload | payload . len ( ) ) . unwrap_or_default ( ) + key . map ( | key | key . len ( ) ) . unwrap_or_default ( ) + header_iter ( headers ) . map ( | ( key , value ) | key . len ( ) + value . len ( ) ) . sum :: < usize > ( ) }
Estimate size of data read from kafka as payload len + key len + headers
Estimate size of data read from kafka as payload len + key len + headers
payload
Option<&[u8]>
key
Option<&[u8]>
headers
Option<&H>
payload
Option<&[u8]>
key
Option<&[u8]>
headers
Option<&H>