pub struct FileWriter<W>where
W: Write,{
pub(crate) writer: W,
pub(crate) options: WriteOptions,
pub(crate) schema: Schema,
pub(crate) ipc_fields: Vec<IpcField>,
pub(crate) block_offsets: usize,
pub(crate) dictionary_blocks: Vec<Block>,
pub(crate) record_blocks: Vec<Block>,
pub(crate) state: State,
pub(crate) dictionary_tracker: DictionaryTracker,
pub(crate) encoded_message: EncodedData,
}
Expand description
Arrow file writer
Fields§
§writer: W
§options: WriteOptions
§schema: Schema
§ipc_fields: Vec<IpcField>
§block_offsets: usize
§dictionary_blocks: Vec<Block>
§record_blocks: Vec<Block>
§state: State
§dictionary_tracker: DictionaryTracker
§encoded_message: EncodedData
Implementations§
§impl<R> FileWriter<R>
impl<R> FileWriter<R>
pub fn try_from_file(
writer: R,
metadata: FileMetadata,
options: WriteOptions
) -> Result<FileWriter<R>, Error>
pub fn try_from_file( writer: R, metadata: FileMetadata, options: WriteOptions ) -> Result<FileWriter<R>, Error>
Creates a new FileWriter
from an existing file, seeking to the last message
and appending new messages afterwards. Users call finish
to write the footer (with both)
the existing and appended messages on it.
§Error
This function errors iff:
- the file’s endianess is not the native endianess (not yet supported)
- the file is not a valid Arrow IPC file
§impl<W> FileWriter<W>where
W: Write,
impl<W> FileWriter<W>where
W: Write,
pub fn try_new(
writer: W,
schema: Schema,
ipc_fields: Option<Vec<IpcField>>,
options: WriteOptions
) -> Result<FileWriter<W>, Error>
pub fn try_new( writer: W, schema: Schema, ipc_fields: Option<Vec<IpcField>>, options: WriteOptions ) -> Result<FileWriter<W>, Error>
Creates a new FileWriter
and writes the header to writer
pub fn new(
writer: W,
schema: Schema,
ipc_fields: Option<Vec<IpcField>>,
options: WriteOptions
) -> FileWriter<W>
pub fn new( writer: W, schema: Schema, ipc_fields: Option<Vec<IpcField>>, options: WriteOptions ) -> FileWriter<W>
Creates a new FileWriter
.
pub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Consumes itself into the inner writer
pub fn get_scratches(&mut self) -> EncodedData
pub fn get_scratches(&mut self) -> EncodedData
Get the inner memory scratches so they can be reused in a new writer. This can be utilized to save memory allocations for performance reasons.
pub fn set_scratches(&mut self, scratches: EncodedData)
pub fn set_scratches(&mut self, scratches: EncodedData)
Set the inner memory scratches so they can be reused in a new writer. This can be utilized to save memory allocations for performance reasons.
pub fn start(&mut self) -> Result<(), Error>
pub fn start(&mut self) -> Result<(), Error>
Writes the header and first (schema) message to the file.
§Errors
Errors if the file has been started or has finished.
Auto Trait Implementations§
impl<W> Freeze for FileWriter<W>where
W: Freeze,
impl<W> !RefUnwindSafe for FileWriter<W>
impl<W> Send for FileWriter<W>where
W: Send,
impl<W> Sync for FileWriter<W>where
W: Sync,
impl<W> Unpin for FileWriter<W>where
W: Unpin,
impl<W> !UnwindSafe for FileWriter<W>
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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> ⓘ
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> ⓘ
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