pub trait Descriptor<'buf>: Sized {
    // Required method
    fn from_bytes(buf: &'buf [u8]) -> Result<Self, DescriptorError>;
}
Expand description

Trait allowing users of this trait to supply their own implementation of descriptor parsing.

The default implementation provided by this crate is CoreDescriptors, which will only provide support for descriptor types directly defined by ISO/IEC 13818-1. To support descriptors from other standards, an alternative implementation of this trait may be passed as a type parameter to methods such as PmtSection::descriptors().

The descriptor_enum!{} macro can be used to help create implementations of this trait.

Required Methods§

source

fn from_bytes(buf: &'buf [u8]) -> Result<Self, DescriptorError>

Create an object that that can wrap and parse the type of descriptor at the start of the given slice.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'buf> Descriptor<'buf> for CoreDescriptors<'buf>