pub struct BinaryNestedEncoder { /* private fields */ }Expand description
Binary nested structure encoder for LNMP v0.5
Encodes nested records and arrays with depth validation and size limits.
Implementations§
Source§impl BinaryNestedEncoder
impl BinaryNestedEncoder
Sourcepub fn with_config(config: NestedEncoderConfig) -> Self
pub fn with_config(config: NestedEncoderConfig) -> Self
Creates a nested encoder with custom configuration
Sourcepub fn encode_nested_record(
&self,
record: &LnmpRecord,
) -> Result<Vec<u8>, BinaryError>
pub fn encode_nested_record( &self, record: &LnmpRecord, ) -> Result<Vec<u8>, BinaryError>
Encodes a nested record to binary format
Binary layout:
┌──────────┬──────────────┬─────────────────────────────────┐
│ TAG │ FIELD_COUNT │ FIELD ENTRIES... │
│ (1 byte) │ (VarInt) │ { FID | VALUE }* │
└──────────┴──────────────┴─────────────────────────────────┘§Arguments
record- The nested record to encode
§Returns
A vector of bytes representing the binary-encoded nested record
§Errors
Returns BinaryError if:
- Nesting depth exceeds configured maximum
- Record size exceeds configured maximum
- Field encoding fails
Sourcepub fn encode_nested_array(
&self,
records: &[LnmpRecord],
) -> Result<Vec<u8>, BinaryError>
pub fn encode_nested_array( &self, records: &[LnmpRecord], ) -> Result<Vec<u8>, BinaryError>
Encodes a nested array to binary format
Binary layout:
┌──────────┬──────────────┬─────────────────────────────────┐
│ TAG │ ELEM_COUNT │ RECORD ENTRIES... │
│ (1 byte) │ (VarInt) │ [ RECORD(...) ]* │
└──────────┴──────────────┴─────────────────────────────────┘§Arguments
records- The array of records to encode
§Returns
A vector of bytes representing the binary-encoded nested array
§Errors
Returns BinaryError if:
- Nesting depth exceeds configured maximum
- Record size exceeds configured maximum
- Record encoding fails
Trait Implementations§
Source§impl Debug for BinaryNestedEncoder
impl Debug for BinaryNestedEncoder
Auto Trait Implementations§
impl Freeze for BinaryNestedEncoder
impl RefUnwindSafe for BinaryNestedEncoder
impl Send for BinaryNestedEncoder
impl Sync for BinaryNestedEncoder
impl Unpin for BinaryNestedEncoder
impl UnwindSafe for BinaryNestedEncoder
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