pub struct BinaryNestedDecoder { /* private fields */ }Expand description
Binary nested structure decoder for LNMP v0.5
Decodes nested records and arrays with depth validation.
Implementations§
Source§impl BinaryNestedDecoder
impl BinaryNestedDecoder
Sourcepub fn with_config(config: NestedDecoderConfig) -> Self
pub fn with_config(config: NestedDecoderConfig) -> Self
Creates a nested decoder with custom configuration
Sourcepub fn decode_nested_record(
&self,
bytes: &[u8],
) -> Result<(LnmpRecord, usize), BinaryError>
pub fn decode_nested_record( &self, bytes: &[u8], ) -> Result<(LnmpRecord, usize), BinaryError>
Decodes a nested record from binary format
Binary layout:
┌──────────┬──────────────┬─────────────────────────────────┐
│ TAG │ FIELD_COUNT │ FIELD ENTRIES... │
│ (1 byte) │ (VarInt) │ { FID | VALUE }* │
└──────────┴──────────────┴─────────────────────────────────┘§Arguments
bytes- The binary data to decode
§Returns
A tuple of (decoded_record, bytes_consumed)
§Errors
Returns BinaryError if:
- Nesting depth exceeds configured maximum
- Binary data is malformed
- TAG byte is not 0x06
Sourcepub fn decode_nested_array(
&self,
bytes: &[u8],
) -> Result<(Vec<LnmpRecord>, usize), BinaryError>
pub fn decode_nested_array( &self, bytes: &[u8], ) -> Result<(Vec<LnmpRecord>, usize), BinaryError>
Decodes a nested array from binary format
Binary layout:
┌──────────┬──────────────┬─────────────────────────────────┐
│ TAG │ ELEM_COUNT │ RECORD ENTRIES... │
│ (1 byte) │ (VarInt) │ [ RECORD(...) ]* │
└──────────┴──────────────┴─────────────────────────────────┘§Arguments
bytes- The binary data to decode
§Returns
A tuple of (decoded_records, bytes_consumed)
§Errors
Returns BinaryError if:
- Nesting depth exceeds configured maximum
- Binary data is malformed
- TAG byte is not 0x07
Trait Implementations§
Source§impl Debug for BinaryNestedDecoder
impl Debug for BinaryNestedDecoder
Auto Trait Implementations§
impl Freeze for BinaryNestedDecoder
impl RefUnwindSafe for BinaryNestedDecoder
impl Send for BinaryNestedDecoder
impl Sync for BinaryNestedDecoder
impl Unpin for BinaryNestedDecoder
impl UnwindSafe for BinaryNestedDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more