Skip to main content

encode_into_with_cache

Function encode_into_with_cache 

Source
pub fn encode_into_with_cache(
    env: &ObsEnvelope,
    out: &mut Vec<u8>,
    cache: &mut SizeCache,
)
Expand description

Encode env into out reusing a caller-owned SizeCache.

The cache is cleared before each encode so subsequent calls see a fresh computation but do not reallocate the backing storage. Drop the cache when the flush window closes or simply keep it alive for the life of the writer task — neither mutates the envelope.