Skip to main content

DatagramParser

Trait DatagramParser 

Source
pub trait DatagramParser {
    // Required method
    fn parse<'a>(&mut self, buf: &'a [u8]) -> Result<&'a [u8]>;
}
Expand description

A trait for parsing and interpreting datagrams. Somewhat similar to DatagramDecoder, but instead it returns part of the same buf instead of creating a new

Required Methods§

Source

fn parse<'a>(&mut self, buf: &'a [u8]) -> Result<&'a [u8]>

Parses the entire datagram, validating both the header and footer.

§Arguments
  • buf - A slice containing the entire datagram.
§Returns
  • io::Result<&'a [u8]> - The slice that is available for reading.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§