pub struct TestNetwork { /* private fields */ }Expand description
A test network consisting of gateways and peer nodes
Implementations§
Source§impl TestNetwork
impl TestNetwork
Source§impl TestNetwork
impl TestNetwork
Sourcepub fn builder() -> NetworkBuilder
pub fn builder() -> NetworkBuilder
Create a new network builder
Sourcepub fn gateway_ws_urls(&self) -> Vec<String>
pub fn gateway_ws_urls(&self) -> Vec<String>
Get all gateway WebSocket URLs
Sourcepub fn peer_ws_urls(&self) -> Vec<String>
pub fn peer_ws_urls(&self) -> Vec<String>
Get all peer WebSocket URLs
Sourcepub async fn wait_until_ready(&self) -> Result<()>
pub async fn wait_until_ready(&self) -> Result<()>
Wait until the network is ready for use
This checks that peers have formed connections and the network is sufficiently connected for testing.
Sourcepub async fn wait_until_ready_with_timeout(
&self,
timeout: Duration,
) -> Result<()>
pub async fn wait_until_ready_with_timeout( &self, timeout: Duration, ) -> Result<()>
Wait until the network is ready with a custom timeout
Sourcepub async fn topology(&self) -> Result<NetworkTopology>
pub async fn topology(&self) -> Result<NetworkTopology>
Get the current network topology
Sourcepub fn export_for_viz(&self) -> String
pub fn export_for_viz(&self) -> String
Export network information in JSON format for visualization tools
Sourcepub async fn collect_diagnostics(&self) -> Result<NetworkDiagnosticsSnapshot>
pub async fn collect_diagnostics(&self) -> Result<NetworkDiagnosticsSnapshot>
Collect diagnostics from every peer, returning a snapshot that can be serialized to JSON for offline analysis.
Sourcepub async fn ring_snapshot(&self) -> Result<Vec<RingPeerSnapshot>>
pub async fn ring_snapshot(&self) -> Result<Vec<RingPeerSnapshot>>
Collect per-peer ring data (locations + adjacency) for visualization/debugging.
Auto Trait Implementations§
impl Freeze for TestNetwork
impl !RefUnwindSafe for TestNetwork
impl Send for TestNetwork
impl !Sync for TestNetwork
impl Unpin for TestNetwork
impl !UnwindSafe for TestNetwork
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