Skip to main content

Parse

Trait Parse 

Source
pub trait Parse<'a>: Sized {
    type Error;

    // Required method
    fn parse(bytes: &'a [u8]) -> Result<Self, Self::Error>;
}
Expand description

Parse a DVB structure from raw bytes. Borrowing allowed via <'a>; the concrete error type is chosen per implementer.

Required Associated Types§

Source

type Error

The error type this implementer returns. Typically the enclosing crate’s Error enum.

Required Methods§

Source

fn parse(bytes: &'a [u8]) -> Result<Self, Self::Error>

Parse bytes as Self. Returns Err(Self::Error) on any protocol violation or buffer underrun.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§