Skip to main content

BatchObjectHeaderWriter

Struct BatchObjectHeaderWriter 

Source
pub struct BatchObjectHeaderWriter { /* private fields */ }
Expand description

Batch writer that collects multiple object headers in memory and flushes them as a single contiguous I/O pass.

This reduces the number of serialization passes when creating many datasets in parallel — each thread builds its ObjectHeaderWriter independently, then all headers are serialized together.

Implementations§

Source§

impl BatchObjectHeaderWriter

Source

pub fn new() -> Self

Create a new empty batch writer.

Source

pub fn add(&mut self, writer: ObjectHeaderWriter)

Add a pre-built ObjectHeaderWriter to the batch.

Source

pub fn len(&self) -> usize

Number of headers in the batch.

Source

pub fn is_empty(&self) -> bool

Whether the batch is empty.

Source

pub fn compute_sizes(&self) -> Vec<usize>

Compute the serialized size of each header without actually serializing. Returns sizes in the same order as headers were added.

Source

pub fn serialize_all(&self) -> (Vec<u8>, Vec<usize>)

Serialize all headers into a single contiguous buffer. Returns (combined_bytes, offsets) where offsets[i] is the byte offset of header i within the combined buffer.

Trait Implementations§

Source§

impl Default for BatchObjectHeaderWriter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.