Skip to main content

NetworkBuilder

Trait NetworkBuilder 

pub trait NetworkBuilder {
    type Network: NetworkView + NetworkStreamControl + Send + Sync + Clone + 'static;

    // Required method
    fn build<'life0, 'async_trait>(
        self,
        identity: &'life0 OffchainKeypair,
        my_multiaddresses: Vec<Multiaddr>,
        protocol: &'static str,
        allow_private_addresses: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(Self::Network, Box<dyn FnOnce() -> Pin<Box<dyn Future<Output = ()> + Send>> + Send>), impl Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Builder for a network object that returns the network specified in the NetworkBuilder::Network associated type.

Required Associated Types§

Required Methods§

fn build<'life0, 'async_trait>( self, identity: &'life0 OffchainKeypair, my_multiaddresses: Vec<Multiaddr>, protocol: &'static str, allow_private_addresses: bool, ) -> Pin<Box<dyn Future<Output = Result<(Self::Network, Box<dyn FnOnce() -> Pin<Box<dyn Future<Output = ()> + Send>> + Send>), impl Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Build and return an instance of a network viewer along with a process to start and run the network component.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§