pub struct ScenarioBuilder { /* private fields */ }Expand description
Test scenario builder
Implementations§
Source§impl ScenarioBuilder
impl ScenarioBuilder
pub fn new() -> Self
Sourcepub fn with_nodes(self, count: usize) -> Self
pub fn with_nodes(self, count: usize) -> Self
Add nodes to the scenario
Sourcepub fn with_config(self, config: ChaosConfig) -> Self
pub fn with_config(self, config: ChaosConfig) -> Self
Set network conditions
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Set test duration
Sourcepub fn with_tick_interval(self, interval: Duration) -> Self
pub fn with_tick_interval(self, interval: Duration) -> Self
Set tick interval
Sourcepub fn build(self) -> (NetworkSimulator, Vec<NodeId>)
pub fn build(self) -> (NetworkSimulator, Vec<NodeId>)
Build the simulator
Sourcepub fn tick_interval(&self) -> Duration
pub fn tick_interval(&self) -> Duration
Get tick interval
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScenarioBuilder
impl RefUnwindSafe for ScenarioBuilder
impl Send for ScenarioBuilder
impl Sync for ScenarioBuilder
impl Unpin for ScenarioBuilder
impl UnsafeUnpin for ScenarioBuilder
impl UnwindSafe for ScenarioBuilder
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