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
Flags - Bit flags describing how a protocol takes part in handshake and
discovery. Combine with
|.empty()means the protocol is negotiated but neither required nor advertised. - 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).
Traits§
- Protocol
- The Protocol trait defines the interface for core protocols and custom protocols.
Type Aliases§
- Protocol
Constructor - Boxed protocol constructor stored in the peer pool. Built by
Node::attach_protocolfrom the user’sFn(PeerConn) -> Pclosure. karyon calls it once per connected peer with a typedPeerConnscoped to this protocol. - ProtocolID