pub struct CsvOpener { /* private fields */ }Expand description
A FileOpener that opens a CSV file and yields a FileOpenFuture
Implementations§
Trait Implementations§
Source§impl FileOpener for CsvOpener
impl FileOpener for CsvOpener
Source§fn open(&self, partitioned_file: PartitionedFile) -> Result<FileOpenFuture>
fn open(&self, partitioned_file: PartitionedFile) -> Result<FileOpenFuture>
Open a partitioned CSV file.
If file_meta.range is None, the entire file is opened.
If file_meta.range is Some(FileRange {start, end}), this signifies that the partition
corresponds to the byte range [start, end) within the file.
Note: start or end might be in the middle of some lines. In such cases, the following rules
are applied to determine which lines to read:
- The first line of the partition is the line in which the index of the first character >=
start. - The last line of the partition is the line in which the byte at position
end - 1resides.
Examples:
Consider the following partitions enclosed by braces {}:
{A,1,2,3,4,5,6,7,8,9\n A,1,2,3,4,5,6,7,8,9\n} A,1,2,3,4,5,6,7,8,9\n The lines read would be: [0, 1]
A,{1,2,3,4,5,6,7,8,9\n A,1,2,3,4,5,6,7,8,9\n A},1,2,3,4,5,6,7,8,9\n The lines read would be: [1, 2]
Auto Trait Implementations§
impl Freeze for CsvOpener
impl !RefUnwindSafe for CsvOpener
impl Send for CsvOpener
impl Sync for CsvOpener
impl Unpin for CsvOpener
impl UnsafeUnpin for CsvOpener
impl !UnwindSafe for CsvOpener
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> 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