pub struct Iperf3Engine { /* private fields */ }Expand description
iperf3 measurement by spawning the system iperf3 binary with -J JSON output.
Requires iperf3 on PATH unless overridden with with_binary.
UDP mode (with_udp) fills jitter and packet loss; TCP mode does not.
Implementations§
Source§impl Iperf3Engine
impl Iperf3Engine
Sourcepub fn with_binary(self, binary: impl Into<PathBuf>) -> Self
pub fn with_binary(self, binary: impl Into<PathBuf>) -> Self
Path to the iperf3 executable (default: "iperf3" on PATH).
Sourcepub fn with_duration_secs(self, secs: u64) -> Self
pub fn with_duration_secs(self, secs: u64) -> Self
Test duration in seconds for each iperf3 direction (minimum 1).
Sourcepub fn with_udp(self, udp: bool) -> Self
pub fn with_udp(self, udp: bool) -> Self
Use UDP (-u) instead of TCP; enables packet-loss reporting when the server supports it.
Sourcepub fn with_bandwidth(self, bandwidth: impl Into<String>) -> Self
pub fn with_bandwidth(self, bandwidth: impl Into<String>) -> Self
UDP target bandwidth passed to iperf3 -b (default "10M").
Sourcepub fn bps_from_json(json: &Iperf3Json, reverse: bool) -> Result<f64, Error>
pub fn bps_from_json(json: &Iperf3Json, reverse: bool) -> Result<f64, Error>
Parse bps from fixture/live JSON. reverse → prefer received (download).
pub fn udp_stats(json: &Iperf3Json) -> (Option<f64>, Option<f64>)
Trait Implementations§
Source§impl Clone for Iperf3Engine
impl Clone for Iperf3Engine
Source§fn clone(&self) -> Iperf3Engine
fn clone(&self) -> Iperf3Engine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Iperf3Engine
impl Debug for Iperf3Engine
Source§impl Default for Iperf3Engine
impl Default for Iperf3Engine
Source§impl MeasurementEngine for Iperf3Engine
impl MeasurementEngine for Iperf3Engine
Auto Trait Implementations§
impl Freeze for Iperf3Engine
impl RefUnwindSafe for Iperf3Engine
impl Send for Iperf3Engine
impl Sync for Iperf3Engine
impl Unpin for Iperf3Engine
impl UnsafeUnpin for Iperf3Engine
impl UnwindSafe for Iperf3Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more