Skip to main content

with_header_pool

Function with_header_pool 

Source
pub fn with_header_pool<F, R>(f: F) -> R
where F: FnOnce(&mut HeaderPool) -> R,
Expand description

Access the thread-local header pool directly.

Use this when you need to encode multiple headers in sequence without copying.

ยงExample

โ“˜
with_header_pool(|pool| {
    let buf1 = pool.encode(&header1);
    let buf2 = pool.encode(&header2);
    // Use buf1 and buf2...
});