pub struct Testnet {
pub bootstrap: Vec<String>,
pub nodes: Vec<Dht>,
}Expand description
Create a testnet of Dht nodes to run tests against instead of the real mainline network.
Fields§
§bootstrap: Vec<String>bootstrapping nodes for this testnet.
nodes: Vec<Dht>all nodes in this testnet
Implementations§
Source§impl Testnet
impl Testnet
Sourcepub fn new(count: usize) -> Result<Testnet, Error>
pub fn new(count: usize) -> Result<Testnet, Error>
Create a new testnet with a certain size.
Note: this network will be shutdown as soon as this struct
gets dropped, if you want the network to be 'static, then
you should call Self::leak.
This will block until all nodes are bootstrapped, if you are using an async runtime, consider using Self::new_async.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Testnet
impl RefUnwindSafe for Testnet
impl Send for Testnet
impl Sync for Testnet
impl Unpin for Testnet
impl UnwindSafe for Testnet
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