Skip to main content

ProtocolConstructor

Type Alias ProtocolConstructor 

Source
pub type ProtocolConstructor = dyn Fn(PeerConn) -> Arc<dyn Protocol> + Send + Sync;
Expand description

Boxed protocol constructor stored in the peer pool. Built by Node::attach_protocol from the user’s Fn(PeerConn) -> P closure. karyon calls it once per connected peer with a typed PeerConn scoped to this protocol.