pub struct PvdDecoder { /* private fields */ }Expand description
PVD Decoder state
Implementations§
Source§impl PvdDecoder
impl PvdDecoder
Sourcepub fn decode_monitor_update(
&self,
data: &[u8],
desc: &StructureDesc,
) -> DecodeResult<MonitorUpdate>
pub fn decode_monitor_update( &self, data: &[u8], desc: &StructureDesc, ) -> DecodeResult<MonitorUpdate>
Decode a MONITOR update in specification order: changed bitset, then the delta data, then the overrun bitset.
Sourcepub fn decode_monitor_update_lenient(
&self,
data: &[u8],
desc: &StructureDesc,
) -> DecodeResult<(MonitorUpdate, MonitorLayout)>
pub fn decode_monitor_update_lenient( &self, data: &[u8], desc: &StructureDesc, ) -> DecodeResult<(MonitorUpdate, MonitorLayout)>
Try all three known layouts and report which one won.
For mid-stream packet captures, where the introspection was missed and
the peer’s layout is unknown. Live connections should use
PvdDecoder::decode_monitor_update.
Source§impl PvdDecoder
impl PvdDecoder
pub fn new(is_be: bool) -> Self
Sourcepub fn with_limits(is_be: bool, limits: DecodeLimits) -> Self
pub fn with_limits(is_be: bool, limits: DecodeLimits) -> Self
Build a decoder with non-default array-length ceilings.
Sourcepub fn limits(&self) -> &DecodeLimits
pub fn limits(&self) -> &DecodeLimits
The array-length ceilings this decoder was built with.
Sourcepub fn decode_size(&self, data: &[u8]) -> DecodeResult<(usize, usize)>
pub fn decode_size(&self, data: &[u8]) -> DecodeResult<(usize, usize)>
Decode a size value (PVA variable-length encoding)
Sourcepub fn decode_string(&self, data: &[u8]) -> DecodeResult<(String, usize)>
pub fn decode_string(&self, data: &[u8]) -> DecodeResult<(String, usize)>
Decode a string
Sourcepub fn parse_field_desc(&self, data: &[u8]) -> DecodeResult<(FieldDesc, usize)>
pub fn parse_field_desc(&self, data: &[u8]) -> DecodeResult<(FieldDesc, usize)>
Parse field description from introspection data
Sourcepub fn parse_introspection(&self, data: &[u8]) -> DecodeResult<StructureDesc>
pub fn parse_introspection(&self, data: &[u8]) -> DecodeResult<StructureDesc>
Parse the full type introspection from INIT response
Sourcepub fn parse_introspection_with_len(
&self,
data: &[u8],
) -> DecodeResult<(StructureDesc, usize)>
pub fn parse_introspection_with_len( &self, data: &[u8], ) -> DecodeResult<(StructureDesc, usize)>
Parse full type introspection and return consumed bytes.
Sourcepub fn decode_value(
&self,
data: &[u8],
field_type: &FieldType,
) -> DecodeResult<(DecodedValue, usize)>
pub fn decode_value( &self, data: &[u8], field_type: &FieldType, ) -> DecodeResult<(DecodedValue, usize)>
Decode value according to field type
Sourcepub fn decode_structure(
&self,
data: &[u8],
desc: &StructureDesc,
) -> DecodeResult<(DecodedValue, usize)>
pub fn decode_structure( &self, data: &[u8], desc: &StructureDesc, ) -> DecodeResult<(DecodedValue, usize)>
Decode a structure value using the field descriptions
Sourcepub fn decode_structure_with_bitset(
&self,
data: &[u8],
desc: &StructureDesc,
) -> DecodeResult<(DecodedValue, usize)>
pub fn decode_structure_with_bitset( &self, data: &[u8], desc: &StructureDesc, ) -> DecodeResult<(DecodedValue, usize)>
Decode a structure with a bitset indicating which fields are present This is used for delta updates in MONITOR