Trait IncomingChannelFactory

Source
pub trait IncomingChannelFactory: Send + Sync {
    type Stream: Send + Sync + 'static;

    // Required method
    fn accept_from_transport<'life0, 'async_trait>(
        &'life0 self,
        peer: SocketAddr,
        stream: Self::Stream,
        memquota: ChannelAccount,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<Channel>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Similar to ChannelFactory, but for building channels from incoming streams.

Required Associated Types§

Source

type Stream: Send + Sync + 'static

The type of byte stream that’s required to build channels for incoming connections.

Required Methods§

Source

fn accept_from_transport<'life0, 'async_trait>( &'life0 self, peer: SocketAddr, stream: Self::Stream, memquota: ChannelAccount, ) -> Pin<Box<dyn Future<Output = Result<Arc<Channel>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Available on crate feature relay only.

Open a channel from peer with the given stream. The channel may or may not be authenticated.

Implementors§