pub struct TestEncoder;Expand description
RowEncoder writing each row as u32 little-endian length + bytes.
Decode captured frames with decode_rows.
Trait Implementations§
Source§impl Clone for TestEncoder
impl Clone for TestEncoder
Source§fn clone(&self) -> TestEncoder
fn clone(&self) -> TestEncoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TestEncoder
Source§impl Debug for TestEncoder
impl Debug for TestEncoder
Source§impl Default for TestEncoder
impl Default for TestEncoder
Source§fn default() -> TestEncoder
fn default() -> TestEncoder
Returns the “default value” for a type. Read more
Source§impl RowEncoder<Owned<Vec<u8>>> for TestEncoder
impl RowEncoder<Owned<Vec<u8>>> for TestEncoder
Source§fn encode<'buf>(
&mut self,
rec: &Record<Vec<u8>>,
buf: &mut BytesMut,
) -> Result<(), SinkError>
fn encode<'buf>( &mut self, rec: &Record<Vec<u8>>, buf: &mut BytesMut, ) -> Result<(), SinkError>
Append
rec’s encoding to buf. Errors are record-level and
subject to the sink stage’s ErrorPolicy — except errors of
ErrorClass::Fatal, which stop
the pipeline regardless of policy (fatal means the encoder itself
is broken, e.g. the row type cannot match the target schema; every
subsequent record would fail identically).Source§fn buffered_bytes(&self) -> usize
fn buffered_bytes(&self) -> usize
Bytes the encoder is holding internally that have not yet been
flushed to a frame. Row formats append directly in
encode and buffer nothing, so the default is 0.
Columnar formats (which must transpose a whole block before any bytes
exist) return the approximate size of the block under assembly; the
terminal stage adds this to the shard buffer length when deciding
whether to seal a chunk, so a columnar block still respects
ChunkConfig::target_bytes.Source§fn finish_chunk(&mut self, buf: &mut BytesMut) -> Result<(), SinkError>
fn finish_chunk(&mut self, buf: &mut BytesMut) -> Result<(), SinkError>
Finalize the pending chunk: flush any internally-buffered rows into
buf as exactly one complete, self-describing wire frame, leaving
the encoder empty and ready for the next chunk. Row formats already
wrote every row in encode, so the default is a
no-op. The terminal stage calls this immediately before it seals each
EncodedChunk — in steady state, on data lulls, and at drain — so a
columnar encoder’s buffered rows are never silently dropped. Read moreAuto Trait Implementations§
impl Freeze for TestEncoder
impl RefUnwindSafe for TestEncoder
impl Send for TestEncoder
impl Sync for TestEncoder
impl Unpin for TestEncoder
impl UnsafeUnpin for TestEncoder
impl UnwindSafe for TestEncoder
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