Skip to main content

record_bang_bounded

Function record_bang_bounded 

Source
pub fn record_bang_bounded(
    source: &Stream,
    max_items: usize,
) -> Result<StreamRecording>
Expand description

Drains source to done, capturing at most max_items packets.

Like record_bang but with a caller-chosen bound. A live or unbounded source never reaches done; recording stops and returns an error once it has pulled max_items packets, so the call cannot loop forever. Prefer this over record_bang whenever the source may not terminate.