pub struct VbBlockWriter<W>where
W: Write,{ /* private fields */ }Expand description
Deterministic VB block writer packing records in order.
Records fill the current block while they fit within 32760 bytes; a new block starts otherwise. Reserved bytes are zero.
Implementations§
Source§impl<W> VbBlockWriter<W>where
W: Write,
impl<W> VbBlockWriter<W>where
W: Write,
Sourcepub fn new(output: W) -> VbBlockWriter<W>
pub fn new(output: W) -> VbBlockWriter<W>
Create a new VB block writer.
Sourcepub fn write_record_from_payload(
&mut self,
payload: &[u8],
reserved: u16,
) -> Result<(), Error>
pub fn write_record_from_payload( &mut self, payload: &[u8], reserved: u16, ) -> Result<(), Error>
Buffer one payload with an RDW header (length includes the header).
§Errors
Returns CBKF222_BDW_LENGTH_INVALID when the framed record exceeds
the 32756-byte maximum, before any allocation beyond the payload.
Sourcepub const fn block_count(&self) -> u64
pub const fn block_count(&self) -> u64
Number of blocks flushed.
Sourcepub const fn record_count(&self) -> u64
pub const fn record_count(&self) -> u64
Number of records buffered or written.
Sourcepub const fn physical_bytes(&self) -> u64
pub const fn physical_bytes(&self) -> u64
Physical bytes written, headers included.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for VbBlockWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for VbBlockWriter<W>where
W: RefUnwindSafe,
impl<W> Send for VbBlockWriter<W>where
W: Send,
impl<W> Sync for VbBlockWriter<W>where
W: Sync,
impl<W> Unpin for VbBlockWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for VbBlockWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for VbBlockWriter<W>where
W: UnwindSafe,
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