pub enum AsyncWritable {
Dyn(AsyncDynWritable),
Local(File),
Cloud(CloudWriterIoTraitWrap),
}Available on crate feature
polars-io only.Expand description
Holds an async writable file, abstracted over local files or cloud files.
This implements DerefMut to a trait object implementing [tokio::io::AsyncWrite].
Note: It is important that you do not call shutdown() on the deref’ed AsyncWrite object.
You should instead call the AsyncWritable::close at the end.
Variants§
Implementations§
Source§impl AsyncWritable
impl AsyncWritable
pub async fn try_new( path: PlRefPath, cloud_options: Option<&CloudOptions>, cloud_upload_chunk_size: usize, cloud_upload_concurrency: usize, io_metrics: Option<Arc<IOMetrics>>, ) -> Result<AsyncWritable, PolarsError>
Sourcepub async fn write_all_owned<T>(&mut self, src: &mut T) -> Result<(), Error>
pub async fn write_all_owned<T>(&mut self, src: &mut T) -> Result<(), Error>
If this writer holds a cloud writer, it will mem::take(T). T is unmodified for other
writer types.
pub async fn sync_all(&mut self) -> Result<(), Error>
pub async fn sync_data(&mut self) -> Result<(), Error>
pub async fn close(self, sync: SyncOnCloseType) -> Result<(), PolarsError>
Trait Implementations§
Source§impl Deref for AsyncWritable
impl Deref for AsyncWritable
Source§impl DerefMut for AsyncWritable
impl DerefMut for AsyncWritable
Auto Trait Implementations§
impl !Freeze for AsyncWritable
impl !RefUnwindSafe for AsyncWritable
impl Send for AsyncWritable
impl !Sync for AsyncWritable
impl Unpin for AsyncWritable
impl UnsafeUnpin for AsyncWritable
impl !UnwindSafe for AsyncWritable
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