pub struct DataEncoder { /* private fields */ }Expand description
Data section encoder
Builds a data section by encoding values and tracking offsets. Supports deduplication - identical values get the same offset. Also supports string interning - duplicate strings are replaced with pointers.
Implementations§
Source§impl DataEncoder
impl DataEncoder
Sourcepub fn new_without_interning() -> Self
pub fn new_without_interning() -> Self
Create a new encoder without string interning (legacy behavior)
Sourcepub fn encode(&mut self, value: &DataValue) -> u32
pub fn encode(&mut self, value: &DataValue) -> u32
Encode a value and return its offset
If the value was previously encoded, returns the existing offset. This enables automatic deduplication at the value level. String interning happens during encoding for sub-strings within maps/arrays.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Get the final encoded data section
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataEncoder
impl RefUnwindSafe for DataEncoder
impl Send for DataEncoder
impl Sync for DataEncoder
impl Unpin for DataEncoder
impl UnwindSafe for DataEncoder
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