pub trait SectionProcessor {
type Context;
// Required methods
fn start_section(
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
section_data: &[u8],
);
fn continue_section(&mut self, ctx: &mut Self::Context, section_data: &[u8]);
fn reset(&mut self);
}Expand description
Trait for types which process the data within a PSI section following the 12-byte
section_length field (which is one of the items available in the SectionCommonHeader that
is passed in.
- For PSI tables that use ‘section syntax’, the existing
SectionSyntaxSectionProcessorimplementation of this trait can be used. - This trait should be implemented directly for PSI tables that use ‘compact’ syntax (i.e.
they lack the 5-bytes-worth of fields represented by
TableSyntaxHeader)
Implementations of this trait will need to use the section_length method of the header
param passed to start_section() to determine when the complete section has been supplied
(if the complete header is not supplied in the call to start_section() more data may be
supplied in one or more subsequent calls to continue_section().
Required Associated Types§
Required Methods§
Sourcefn start_section(
&mut self,
ctx: &mut Self::Context,
header: &SectionCommonHeader,
section_data: &[u8],
)
fn start_section( &mut self, ctx: &mut Self::Context, header: &SectionCommonHeader, section_data: &[u8], )
Note that the first 3 bytes of section_data contain the header fields that have also
been supplied to this call in the header parameter. This is to allow implementers to
calculate a CRC over the whole section if required.
Sourcefn continue_section(&mut self, ctx: &mut Self::Context, section_data: &[u8])
fn continue_section(&mut self, ctx: &mut Self::Context, section_data: &[u8])
may be called to pass the implementation additional slices of section data, if the complete section was not already passed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".