Struct netem_trace::model::loss::StaticLoss
source · pub struct StaticLoss {
pub loss: LossPattern,
pub duration: Option<Duration>,
}Expand description
The model of a static loss trace.
Examples
let mut static_loss = StaticLossConfig::new()
.loss(vec![0.1, 0.2])
.duration(Duration::from_secs(1))
.build();
assert_eq!(static_loss.next_loss(), Some((vec![0.1, 0.2], Duration::from_secs(1))));
assert_eq!(static_loss.next_loss(), None);Fields§
§loss: LossPattern§duration: Option<Duration>Trait Implementations§
source§impl Clone for StaticLoss
impl Clone for StaticLoss
source§fn clone(&self) -> StaticLoss
fn clone(&self) -> StaticLoss
Returns a copy of the value. Read more
1.0.0 · 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 StaticLoss
impl Debug for StaticLoss
source§impl LossTrace for StaticLoss
impl LossTrace for StaticLoss
Auto Trait Implementations§
impl RefUnwindSafe for StaticLoss
impl Send for StaticLoss
impl Sync for StaticLoss
impl Unpin for StaticLoss
impl UnwindSafe for StaticLoss
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