Skip to main content

IncomingChannelFactory

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: Sensitive<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: Sensitive<SocketAddr>, stream: Self::Stream, memquota: ChannelAccount, ) -> Pin<Box<dyn Future<Output = Result<Arc<Channel>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§