pub struct FeatherBuffer { /* private fields */ }
Expand description
A FeatherBuffer
encodes data via an Arrow StreamWriter
.
It flushes the internal byte buffer according to rotation policy.
Implementations§
Source§impl FeatherBuffer
impl FeatherBuffer
Sourcepub fn new(
schema: &Schema,
rotation_config: RotationConfig,
) -> Result<Self, ArrowError>
pub fn new( schema: &Schema, rotation_config: RotationConfig, ) -> Result<Self, ArrowError>
Creates a new FileWriter
using the given path, schema and maximum buffer size.
Sourcepub fn write_record_batch(
&mut self,
batch: &RecordBatch,
) -> Result<bool, ArrowError>
pub fn write_record_batch( &mut self, batch: &RecordBatch, ) -> Result<bool, ArrowError>
Writes the given RecordBatch
to the internal buffer.
Returns true if it should be rotated according rotation policy
Sourcepub fn take_buffer(&mut self) -> Result<Vec<u8>, ArrowError>
pub fn take_buffer(&mut self) -> Result<Vec<u8>, ArrowError>
Consumes the writer and returns the buffer of bytes from the StreamWriter
Sourcepub const fn should_rotate(&self) -> bool
pub const fn should_rotate(&self) -> bool
Should rotate
Auto Trait Implementations§
impl Freeze for FeatherBuffer
impl RefUnwindSafe for FeatherBuffer
impl Send for FeatherBuffer
impl Sync for FeatherBuffer
impl Unpin for FeatherBuffer
impl UnwindSafe for FeatherBuffer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more