Struct parquet2::write::FileStreamer
source · pub struct FileStreamer<W: AsyncWrite + Unpin + Send> { /* private fields */ }
Expand description
An interface to write a parquet file asynchronously.
Use start
to write the header, write
to write a row group,
and end
to write the footer.
Implementations§
source§impl<W: AsyncWrite + Unpin + Send> FileStreamer<W>
impl<W: AsyncWrite + Unpin + Send> FileStreamer<W>
sourcepub fn options(&self) -> &WriteOptions
pub fn options(&self) -> &WriteOptions
The options assigned to the file
sourcepub fn schema(&self) -> &SchemaDescriptor
pub fn schema(&self) -> &SchemaDescriptor
The SchemaDescriptor
assigned to this file
source§impl<W: AsyncWrite + Unpin + Send> FileStreamer<W>
impl<W: AsyncWrite + Unpin + Send> FileStreamer<W>
sourcepub fn new(
writer: W,
schema: SchemaDescriptor,
options: WriteOptions,
created_by: Option<String>
) -> Self
pub fn new( writer: W, schema: SchemaDescriptor, options: WriteOptions, created_by: Option<String> ) -> Self
Returns a new FileStreamer
.
sourcepub async fn write<E>(&mut self, row_group: RowGroupIter<'_, E>) -> Result<()>
pub async fn write<E>(&mut self, row_group: RowGroupIter<'_, E>) -> Result<()>
Writes a row group to the file.
sourcepub async fn end(
&mut self,
key_value_metadata: Option<Vec<KeyValue>>
) -> Result<u64>
pub async fn end( &mut self, key_value_metadata: Option<Vec<KeyValue>> ) -> Result<u64>
Writes the footer of the parquet file. Returns the total size of the file and the underlying writer.
sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Returns the underlying writer.
Auto Trait Implementations§
impl<W> Freeze for FileStreamer<W>where
W: Freeze,
impl<W> !RefUnwindSafe for FileStreamer<W>
impl<W> Send for FileStreamer<W>
impl<W> Sync for FileStreamer<W>where
W: Sync,
impl<W> Unpin for FileStreamer<W>
impl<W> !UnwindSafe for FileStreamer<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
Mutably borrows from an owned value. Read more