Trait litep2p::protocol::UserProtocol

source ·
pub trait UserProtocol: Send {
    // Required methods
    fn protocol(&self) -> ProtocolName;
    fn codec(&self) -> ProtocolCodec;
    fn run<'async_trait>(
        self: Box<Self>,
        service: TransportService,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Trait defining the interface for a user protocol.

Required Methods§

source

fn protocol(&self) -> ProtocolName

Get user protocol name.

source

fn codec(&self) -> ProtocolCodec

Get user protocol codec.

source

fn run<'async_trait>( self: Box<Self>, service: TransportService, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,

Start the the user protocol event loop.

Implementors§