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 FeatherBuffer using the given path, schema and maximum buffer size.
§Errors
Returns an error if the Arrow stream writer cannot be created.
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
§Errors
Returns an error if Arrow IPC writing fails.
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
§Errors
Returns an error if the replacement writer cannot be created or the previous writer cannot be finalized.
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 UnsafeUnpin for FeatherBuffer
impl UnwindSafe for FeatherBuffer
Blanket Implementations§
impl<T> Allocation for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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