Crate skrillax_protocol

Crate skrillax_protocol 

Source
Expand description

Provides a macro to create ‘protocols’.

This expected to be used for the skrillax_stream crate.

A protocol defines a set of opcodes and their respective structures. It is essentially a mapping of opcode -> struct. To encourage more static dispatch and better developer ergonomics, we want to provide a nice way of constructing these mappings. Otherwise, this would become quite tedious. Additionally, this also generates some convenience functions to automatically move between different protocols that are related.

The macro to use is the define_protocol! macro - any other macro exports are just helper macros and should be ignored.

Macros§

define_inbound_protocol
Defines an “inbound” protocol, i.e. a protocol we only care about receiving from another party.
define_outbound_protocol
Defines an “outbound” protocol, i.e. a protocol we only care about sending out to another party.
define_protocol
Defines a protocol from a list of packets and/or other protocols.