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§
sourcefn protocol(&self) -> ProtocolName
fn protocol(&self) -> ProtocolName
Get user protocol name.
sourcefn codec(&self) -> ProtocolCodec
fn codec(&self) -> ProtocolCodec
Get user protocol codec.