pub trait ProtocolHandler:
Send
+ Sync
+ IntoArcAny
+ Debug
+ 'static {
// Required method
fn accept(self: Arc<Self>, conn: Connecting) -> BoxedFuture<Result<()>>;
// Provided method
fn shutdown(self: Arc<Self>) -> BoxedFuture<()> { ... }
}Expand description
Interface to accept incoming connections for custom protocol implementations.
A node can accept connections for custom protocols. By default, the node only accepts connections for the core protocols (gossip and optionally sync or blobs).
Required Methods§
Sourcefn accept(self: Arc<Self>, conn: Connecting) -> BoxedFuture<Result<()>>
fn accept(self: Arc<Self>, conn: Connecting) -> BoxedFuture<Result<()>>
Handle an incoming connection.
This runs on a freshly spawned tokio task so this can be long-running.
Provided Methods§
Sourcefn shutdown(self: Arc<Self>) -> BoxedFuture<()>
fn shutdown(self: Arc<Self>) -> BoxedFuture<()>
Called when the node shuts down.