Skip to content

Commit

Permalink
feat(model): add send to trace config and model
Browse files Browse the repository at this point in the history
  • Loading branch information
Centaurus99 authored and BobAnkh committed Mar 17, 2024
1 parent 27991e0 commit 1a23a01
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub type LossPattern = Vec<f64>;
///
/// The next_bw function either returns **the next bandwidth and its duration**
/// in the sequence, or **None** if the trace goes to end.
pub trait BwTrace {
pub trait BwTrace: Send {
fn next_bw(&mut self) -> Option<(Bandwidth, Duration)>;
}

Expand All @@ -161,7 +161,7 @@ pub trait BwTrace {
///
/// The next_delay function either returns **the next delay and its duration**
/// in the sequence, or **None** if the trace goes to end.
pub trait DelayTrace {
pub trait DelayTrace: Send {
fn next_delay(&mut self) -> Option<(Delay, Duration)>;
}

Expand All @@ -173,7 +173,7 @@ pub trait DelayTrace {
///
/// The next_loss function either returns **the next loss_pattern and its duration**
/// in the sequence, or **None** if the trace goes to end.
pub trait LossTrace {
pub trait LossTrace: Send {
fn next_loss(&mut self) -> Option<(LossPattern, Duration)>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/bw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const DEFAULT_RNG_SEED: u64 = 42;
/// separate the configuration part into a simple struct for serialization/deserialization, and
/// construct the model from the configuration.
#[cfg_attr(feature = "serde", typetag::serde)]
pub trait BwTraceConfig: DynClone {
pub trait BwTraceConfig: DynClone + Send {
fn into_model(self: Box<Self>) -> Box<dyn BwTrace>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use dyn_clone::DynClone;
/// separate the configuration part into a simple struct for serialization/deserialization, and
/// construct the model from the configuration.
#[cfg_attr(feature = "serde", typetag::serde)]
pub trait DelayTraceConfig: DynClone {
pub trait DelayTraceConfig: DynClone + Send {
fn into_model(self: Box<Self>) -> Box<dyn DelayTrace>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/loss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use dyn_clone::DynClone;
/// separate the configuration part into a simple struct for serialization/deserialization, and
/// construct the model from the configuration.
#[cfg_attr(feature = "serde", typetag::serde)]
pub trait LossTraceConfig: DynClone {
pub trait LossTraceConfig: DynClone + Send {
fn into_model(self: Box<Self>) -> Box<dyn LossTrace>;
}

Expand Down

0 comments on commit 1a23a01

Please sign in to comment.