Struct polars_io::avro::AvroWriter
source · pub struct AvroWriter<W> { /* private fields */ }
Available on crate feature
avro
only.Expand description
Write a DataFrame
to Apache Avro format
§Example
use polars_core::prelude::*;
use polars_io::avro::AvroWriter;
use std::fs::File;
use polars_io::SerWriter;
fn example(df: &mut DataFrame) -> PolarsResult<()> {
let mut file = File::create("file.avro").expect("could not create file");
AvroWriter::new(&mut file)
.finish(df)
}
Implementations§
source§impl<W> AvroWriter<W>where
W: Write,
impl<W> AvroWriter<W>where
W: Write,
sourcepub fn with_compression(self, compression: Option<AvroCompression>) -> Self
pub fn with_compression(self, compression: Option<AvroCompression>) -> Self
Set the compression used. Defaults to None.
pub fn with_name(self, name: String) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for AvroWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for AvroWriter<W>where
W: RefUnwindSafe,
impl<W> Send for AvroWriter<W>where
W: Send,
impl<W> Sync for AvroWriter<W>where
W: Sync,
impl<W> Unpin for AvroWriter<W>where
W: Unpin,
impl<W> UnwindSafe for AvroWriter<W>where
W: UnwindSafe,
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