1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use super::Test;
use crate::{CoreContext, Result, Swarm, TestReport};
pub trait NetworkTest: Test {
fn run<'t>(&self, ctx: &mut NetworkContext<'t>) -> Result<()>;
}
pub struct NetworkContext<'t> {
core: CoreContext,
swarm: &'t mut dyn Swarm,
pub report: &'t mut TestReport,
}
impl<'t> NetworkContext<'t> {
pub fn new(core: CoreContext, swarm: &'t mut dyn Swarm, report: &'t mut TestReport) -> Self {
Self {
core,
swarm,
report,
}
}
pub fn swarm(&mut self) -> &mut dyn Swarm {
self.swarm
}
pub fn core(&mut self) -> &mut CoreContext {
&mut self.core
}
}