pub struct FileIO { /* private fields */ }
Expand description
FileIO implementation, used to manipulate files in underlying storage.
§Note
All path passed to FileIO
must be absolute path starting with scheme string used to construct FileIO
.
For example, if you construct FileIO
with s3a
scheme, then all path passed to FileIO
must start with s3a://
.
Supported storages:
Storage | Feature Flag | Schemes |
---|---|---|
Local file system | storage-fs | file |
Memory | storage-memory | memory |
S3 | storage-s3 | s3 , s3a |
GCS | storage-gcs | gs , gcs |
Implementations§
Source§impl FileIO
impl FileIO
Sourcepub fn into_builder(self) -> FileIOBuilder
pub fn into_builder(self) -> FileIOBuilder
Convert FileIO into FileIOBuilder
which used to build this FileIO.
This function is useful when you want serialize and deserialize FileIO across distributed systems.
Sourcepub fn from_path(path: impl AsRef<str>) -> Result<FileIOBuilder>
pub fn from_path(path: impl AsRef<str>) -> Result<FileIOBuilder>
Try to infer file io scheme from path. See FileIO
for supported schemes.
- If it’s a valid url, for example
s3://bucket/a
, url scheme will be used, and the rest of the url will be ignored. - If it’s not a valid url, will try to detect if it’s a file path.
Otherwise will return parsing error.
Sourcepub fn new_output(&self, path: impl AsRef<str>) -> Result<OutputFile>
pub fn new_output(&self, path: impl AsRef<str>) -> Result<OutputFile>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileIO
impl !RefUnwindSafe for FileIO
impl Send for FileIO
impl Sync for FileIO
impl Unpin for FileIO
impl !UnwindSafe for FileIO
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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