pub enum ReplaySpeed {
RealTime,
Multiplier(f64),
Max,
Pps(u64),
}Expand description
How to pace packet transmission during replay.
Variants§
RealTime
Honour original inter-packet timing (the default).
Multiplier(f64)
Scale timing by a multiplier: >1.0 = faster, <1.0 = slower.
Max
Send as fast as possible with no delay between packets.
Pps(u64)
Fixed transmission rate in packets per second (ignores original timing).
Implementations§
Source§impl ReplaySpeed
impl ReplaySpeed
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse a speed string.
| Input | Result |
|---|---|
"max" | ReplaySpeed::Max |
"1.0" | ReplaySpeed::RealTime |
"2.5" | [ReplaySpeed::Multiplier(2.5)] |
Returns None for non-positive numbers or unrecognised strings.
Trait Implementations§
Source§impl Clone for ReplaySpeed
impl Clone for ReplaySpeed
Source§fn clone(&self) -> ReplaySpeed
fn clone(&self) -> ReplaySpeed
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 moreAuto Trait Implementations§
impl Freeze for ReplaySpeed
impl RefUnwindSafe for ReplaySpeed
impl Send for ReplaySpeed
impl Sync for ReplaySpeed
impl Unpin for ReplaySpeed
impl UnsafeUnpin for ReplaySpeed
impl UnwindSafe for ReplaySpeed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more