Expand description

DiscoRTP is a lightweight, flexible Real-time Transport Protocol parsing library designed for use in non-standards compliant environments, such as Discord.

DiscoRTP differs from other Rust RTP libraries in that packet construction should never fail, unless there are too few bytes. Not all implementations treat fields as they should (i.e., length), and so DiscoRTP’s philosophy is that the user knows best. Packet parsers are building blocks to be manually assembled, and validation mechanisms exist but are manual.

DiscoRTP was originally developed for use in Serenity, and is built using pnet.

All crate features are optional:

  • "rtp" includes copy-free and owned views of RTP packets. Default.
  • "rtcp" includes copy-free and owned views of RTCP packets. Default.
  • "pnet" re-includes traits from pnet for packet view manipulation. Default.
  • "demux" includes utilities for separating multiplexed RTP/RTCP streams.
  • "discord" includes platform-specific packet formats for Discord.


pub use pnet_macros_support as pnet;


Utilities for separating multiplexed RTP/RTCP streams.

Additional packet formats used by Discord.

Readers and writers for the RTP Control Protocol.

Readers and writers for the Real-time Transport Protocol.

Utility types for wrapping arithmetic, compatible with pnet.


Used to convert on-the-wire packets to their #[packet] equivalent.

Represents a generic, mutable, network packet.

Represents a generic network packet.

Used to find the calculated size of the packet. This is used for occasions where the underlying buffer is not the same length as the packet itself.