Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica
Skip to main content

TestTransport

Trait TestTransport 

Source
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§

Source

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.

Implementors§