pub struct InputStream { /* private fields */ }Expand description
A structure for creating a transformation chain from input files.
Most of the time you’ll start your processing chain using .from_readers()
or .from_paths() and then chain the methods of the
RowStream trait. However there are more options
for the cases where you need to customize how your input is read.
Trait Implementations§
Source§impl IntoIterator for InputStream
impl IntoIterator for InputStream
Source§impl RowStream for InputStream
impl RowStream for InputStream
Source§fn headers(&self) -> &Headers
fn headers(&self) -> &Headers
Must return headers as they are in this point of the chain. For example
if implementor adds a column, its
headers() function must return the
new headers including the one just added.Source§fn add(self, column: ColSpec) -> Result<Add<Self>>where
Self: Sized,
fn add(self, column: ColSpec) -> Result<Add<Self>>where
Self: Sized,
Add a column to each row of the stream. Read more
Source§fn del(self, columns: Vec<&str>) -> Del<'_, Self>where
Self: Sized,
fn del(self, columns: Vec<&str>) -> Del<'_, Self>where
Self: Sized,
Deletes the specified columns from each row of the stream. If you have
too many columns to delete perhaps instead use
RowStream::select.Source§fn select(self, columns: Vec<&str>) -> Select<'_, Self>where
Self: Sized,
fn select(self, columns: Vec<&str>) -> Select<'_, Self>where
Self: Sized,
Outputs only the selected columns, ignoring the rest. Read more
Source§fn add_with<F>(
self,
colname: &str,
f: F,
) -> Result<AddWith<Self, F>, BuildError>
fn add_with<F>( self, colname: &str, f: F, ) -> Result<AddWith<Self, F>, BuildError>
Adds a column to each row of the stream using a closure to compute its
value. Read more
Source§fn reduce(self, columns: Vec<Box<dyn Aggregate>>) -> Result<Reduce<Self>>where
Self: Sized,
fn reduce(self, columns: Vec<Box<dyn Aggregate>>) -> Result<Reduce<Self>>where
Self: Sized,
Reduce all the incoming stream into one row, computing some aggregates
in the way. All the stream collapses into one row. Read more
Source§fn adjacent_group<F, R, G>(self, grouping: G, f: F) -> AdjacentGroup<Self, F, G>
fn adjacent_group<F, R, G>(self, grouping: G, f: F) -> AdjacentGroup<Self, F, G>
Groups rows by the given criteria, but assuming a “group” is a set of
adjacent rows. Read more
Source§fn group<F, R, G>(self, grouping: G, f: F) -> Group<Self, F, G>
fn group<F, R, G>(self, grouping: G, f: F) -> Group<Self, F, G>
Groups rows by the given criteria. You’ll be given a RowStream instance
as the first argument of a closure that you can use to further process
the grouped rows. Read more
Source§fn flush<T>(self, target: T) -> Result<Flush<Self, T>>where
Self: Sized,
fn flush<T>(self, target: T) -> Result<Flush<Self, T>>where
Self: Sized,
When consumed, writes to destination specified by the column given in
the first argument. Other than that this behaves like an
id(x)
function so you can specify more links in the chain and even more
flushers.Source§fn review<F>(self, f: F) -> Inspect<Self, F>
fn review<F>(self, f: F) -> Inspect<Self, F>
Mostly for debugging, calls a closure on each element. Behaves like the
identity function on the stream returning each row untouched.
Source§fn rename(self, old_name: &str, new_name: &str) -> Rename<Self>where
Self: Sized,
fn rename(self, old_name: &str, new_name: &str) -> Rename<Self>where
Self: Sized,
Renames some columns
Source§fn map_row<F, H, R>(self, f: F, header_map: H) -> MapRow<Self, F>
fn map_row<F, H, R>(self, f: F, header_map: H) -> MapRow<Self, F>
Apply a function to every row and use the return values to build the
row stream. Read more
Source§fn map_col<F>(self, col: &str, f: F) -> MapCol<Self, F>
fn map_col<F>(self, col: &str, f: F) -> MapCol<Self, F>
Apply a function to a single column of the stream, this function dones’t fail
if the column dones’t exist.
Source§fn filter_col<F>(self, col: &str, f: F) -> Result<FilterCol<Self, F>>
fn filter_col<F>(self, col: &str, f: F) -> Result<FilterCol<Self, F>>
filter entire rows out depending on one column’s value and a
condition, leaving errored rows untouched.
Auto Trait Implementations§
impl Freeze for InputStream
impl !RefUnwindSafe for InputStream
impl Send for InputStream
impl Sync for InputStream
impl Unpin for InputStream
impl !UnwindSafe for InputStream
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