pub trait BatchDeserializer<T>: Send + Debug {
// Required methods
fn digest(&mut self, message: T) -> usize;
fn next(&mut self) -> Result<DeserializerOutput, ArrowError>;
fn finish(&mut self);
}
Expand description
Trait defining a scheme for deserializing byte streams into structured data.
Implementors of this trait are responsible for converting raw bytes into
RecordBatch
objects.
Required Methods§
Sourcefn digest(&mut self, message: T) -> usize
fn digest(&mut self, message: T) -> usize
Feeds a message for deserialization, updating the internal state of
this BatchDeserializer
. Note that one can call this function multiple
times before calling next
, which will queue multiple messages for
deserialization. Returns the number of bytes consumed.
Sourcefn next(&mut self) -> Result<DeserializerOutput, ArrowError>
fn next(&mut self) -> Result<DeserializerOutput, ArrowError>
Attempts to deserialize any pending messages and returns a
DeserializerOutput
to indicate progress.