Trait netem_trace::BwTrace

source ·
pub trait BwTrace {
    // Required method
    fn next_bw(&mut self) -> Option<(Bandwidth, Duration)>;
}
Expand description

This is a trait that represents a trace of bandwidths.

The trace is a sequence of (bandwidth, duration) pairs. The bandwidth describes how many bits can be sent per second. The duration is the time that the bandwidth lasts.

For example, if the sequence is [(1Mbps, 1s), (2Mbps, 2s), (3Mbps, 3s)], then the bandwidth will be 1Mbps for 1s, then 2Mbps for 2s, then 3Mbps for 3s.

The next_bw function either returns the next bandwidth and its duration in the sequence, or None if the trace goes to end.

Required Methods§

source

fn next_bw(&mut self) -> Option<(Bandwidth, Duration)>

Implementors§