pub trait LayerDispatch {
// Required methods
fn dispatch_kind(&self) -> LayerKind;
fn dispatch_index(&self) -> &LayerIndex;
fn dispatch_summary(&self, buf: &[u8]) -> String;
fn dispatch_header_len(&self, buf: &[u8]) -> usize;
fn dispatch_field_names(&self) -> &'static [&'static str];
fn dispatch_get_field(
&self,
buf: &[u8],
name: &str,
) -> Option<Result<FieldValue, FieldError>>;
fn dispatch_set_field(
&self,
buf: &mut [u8],
name: &str,
value: FieldValue,
) -> Option<Result<(), FieldError>>;
fn dispatch_show_fields(&self, buf: &[u8]) -> Vec<(&'static str, String)>;
// Provided method
fn dispatch_hashret(&self, _buf: &[u8]) -> Vec<u8> ⓘ { ... }
}Expand description
Auto-dispatched trait for LayerEnum.
Generated by enum_dispatch to eliminate manual match-arm boilerplate
and enable the compiler to inline dispatch calls more aggressively.
Required Methods§
Sourcefn dispatch_kind(&self) -> LayerKind
fn dispatch_kind(&self) -> LayerKind
Get the kind of this layer.
Sourcefn dispatch_index(&self) -> &LayerIndex
fn dispatch_index(&self) -> &LayerIndex
Get the layer index (start/end offsets).
Sourcefn dispatch_summary(&self, buf: &[u8]) -> String
fn dispatch_summary(&self, buf: &[u8]) -> String
Get a human-readable summary.
Sourcefn dispatch_header_len(&self, buf: &[u8]) -> usize
fn dispatch_header_len(&self, buf: &[u8]) -> usize
Get the header length in bytes.
Sourcefn dispatch_field_names(&self) -> &'static [&'static str]
fn dispatch_field_names(&self) -> &'static [&'static str]
Get field names for this layer type.
Sourcefn dispatch_get_field(
&self,
buf: &[u8],
name: &str,
) -> Option<Result<FieldValue, FieldError>>
fn dispatch_get_field( &self, buf: &[u8], name: &str, ) -> Option<Result<FieldValue, FieldError>>
Get a field value by name.
Sourcefn dispatch_set_field(
&self,
buf: &mut [u8],
name: &str,
value: FieldValue,
) -> Option<Result<(), FieldError>>
fn dispatch_set_field( &self, buf: &mut [u8], name: &str, value: FieldValue, ) -> Option<Result<(), FieldError>>
Set a field value by name.