Expand description
Defines the protocol trait.
Read More
Modules§
Structs§
- Peer
Conn - Per-protocol view of a Peer with the protocol id baked in. Built
by karyon and handed to the protocol constructor. Hides the
underlying
proto_idrouting so user code never types it. - Protocol
Meta - Per-protocol metadata stored in the peer pool.
Enums§
- Protocol
Event - Protocol event used internally by karyon. User code reads
messages via
PeerConn::recvwhich yieldsVec<u8>directly and surfaces shutdown asErr(PeerShutdown). - Protocol
Kind - Whether a protocol is required for handshake / discovery to consider a peer compatible.
Traits§
- Protocol
- The Protocol trait defines the interface for core protocols and custom protocols.
Type Aliases§
- Protocol
Constructor - User-supplied constructor handed to
Node::attach_protocol. karyon calls it once per connected peer with a typedPeerConnscoped to this protocol. Capture whatever shared state the protocol needs in the closure. - ProtocolID