pub enum ReplayRetention {
LastChunks(usize),
LastBytes(NumBytes),
All,
}Expand description
Replay history retained by replay-enabled streams.
Variants§
LastChunks(usize)
Keep the latest number of chunks for future subscribers.
LastBytes(NumBytes)
Keep whole chunks covering at least the latest number of bytes.
Trimming happens at chunk boundaries: chunks are removed from the front of the retained log only while doing so leaves the remaining size at or above the requested limit. Chunks are never split, so the actual retained size is “rounded up to whole chunks.” A single chunk that is itself larger than the configured limit is retained in full until a newer chunk arrives that can replace it; the limit is therefore a soft floor on retention, not a hard upper bound on memory.
To make the practical bound predictable, pair this with a read_chunk_size smaller than
the retention limit so a single chunk cannot exceed the configured budget.
All
Keep all output for the stream lifetime.
This can retain unbounded memory. Use it only when the child process and its output volume are trusted.
Trait Implementations§
Source§impl Clone for ReplayRetention
impl Clone for ReplayRetention
Source§fn clone(&self) -> ReplayRetention
fn clone(&self) -> ReplayRetention
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more