pub trait TestTransport: Send + Sync {
// Required method
fn serve<'life0, 'life1, 'async_trait>(
&'life0 self,
sync: &'life1 Sync,
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
How a peer makes itself reachable to other peers. The one seam Tier 1 swaps: implement this over an in-memory, controllable network and the rest of the harness is unchanged.
Required Methods§
Sourcefn serve<'life0, 'life1, 'async_trait>(
&'life0 self,
sync: &'life1 Sync,
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn serve<'life0, 'life1, 'async_trait>(
&'life0 self,
sync: &'life1 Sync,
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register this transport on sync, start serving, and return the address
other peers use to reach it. Called once per peer at build time.