Struct csvsc::prelude::MockStream [−][src]
A simple struct that helps create RowStreams from vectors.
Implementations
impl<I> MockStream<I> where
I: Iterator<Item = RowResult>,
[src]
I: Iterator<Item = RowResult>,
pub fn new(iter: I, headers: Headers) -> MockStream<I>
[src]
Creates a new object implementing the RowStream trait from an iterator and some headers.
pub fn from_rows(iter: I) -> Result<MockStream<I>, BuildError>
[src]
Creates a new object implementing the RowStream trait from an iterator of RowResult objects, the first of which must be the header row.
Trait Implementations
impl<I: Debug> Debug for MockStream<I>
[src]
impl<I> IntoIterator for MockStream<I> where
I: Iterator<Item = RowResult>,
[src]
I: Iterator<Item = RowResult>,
type Item = RowResult
The type of the elements being iterated over.
type IntoIter = IntoIter<I>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<I> RowStream for MockStream<I> where
MockStream<I>: IntoIterator<Item = RowResult>,
[src]
MockStream<I>: IntoIterator<Item = RowResult>,
fn headers(&self) -> &Headers
[src]
fn add(self, column: ColSpec) -> Result<Add<Self>> where
Self: Sized,
[src]
Self: Sized,
fn del(self, columns: Vec<&str>) -> Del<'_, Self> where
Self: Sized,
[src]
Self: Sized,
fn select(self, columns: Vec<&str>) -> Select<'_, Self> where
Self: Sized,
[src]
Self: Sized,
fn add_with<F>(
self,
colname: &str,
f: F
) -> Result<AddWith<Self, F>, BuildError> where
Self: Sized,
F: FnMut(&Headers, &Row) -> Result<String>,
[src]
self,
colname: &str,
f: F
) -> Result<AddWith<Self, F>, BuildError> where
Self: Sized,
F: FnMut(&Headers, &Row) -> Result<String>,
fn reduce(self, columns: Vec<Box<dyn Aggregate>>) -> Result<Reduce<Self>> where
Self: Sized,
[src]
Self: Sized,
fn adjacent_group<F, R, G>(self, grouping: G, f: F) -> AdjacentGroup<Self, F, G> where
F: Fn(MockStream<IntoIter<RowResult>>) -> R,
R: RowStream,
G: GroupCriteria,
Self: Sized,
[src]
F: Fn(MockStream<IntoIter<RowResult>>) -> R,
R: RowStream,
G: GroupCriteria,
Self: Sized,
fn group<F, R, G>(self, grouping: G, f: F) -> Group<Self, F, G> where
F: Fn(MockStream<IntoIter<RowResult>>) -> R,
R: RowStream,
G: GroupCriteria,
Self: Sized,
[src]
F: Fn(MockStream<IntoIter<RowResult>>) -> R,
R: RowStream,
G: GroupCriteria,
Self: Sized,
fn flush<T>(self, target: T) -> Result<Flush<Self, T>> where
Self: Sized,
[src]
Self: Sized,
fn review<F>(self, f: F) -> Inspect<Self, F> where
Self: Sized,
F: FnMut(&Headers, &RowResult),
[src]
Self: Sized,
F: FnMut(&Headers, &RowResult),
fn rename(self, old_name: &str, new_name: &str) -> Rename<Self> where
Self: Sized,
[src]
Self: Sized,
fn map_row<F, H, R>(self, f: F, header_map: H) -> MapRow<Self, F> where
Self: Sized,
F: Fn(&Headers, &Row) -> Result<R>,
H: Fn(&Headers) -> Headers,
R: Iterator<Item = RowResult>,
[src]
Self: Sized,
F: Fn(&Headers, &Row) -> Result<R>,
H: Fn(&Headers) -> Headers,
R: Iterator<Item = RowResult>,
fn map_col<F>(self, col: &str, f: F) -> MapCol<Self, F> where
Self: Sized,
F: Fn(&str) -> Result<String>,
[src]
Self: Sized,
F: Fn(&str) -> Result<String>,
fn filter_col<F>(self, col: &str, f: F) -> Result<FilterCol<Self, F>> where
Self: Sized,
F: Fn(&str) -> bool,
[src]
Self: Sized,
F: Fn(&str) -> bool,
fn filter_row<F>(self, f: F) -> FilterRow<Self, F> where
Self: Sized,
F: Fn(&Headers, &Row) -> bool,
[src]
Self: Sized,
F: Fn(&Headers, &Row) -> bool,
Auto Trait Implementations
impl<I> RefUnwindSafe for MockStream<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
impl<I> Send for MockStream<I> where
I: Send,
I: Send,
impl<I> Sync for MockStream<I> where
I: Sync,
I: Sync,
impl<I> Unpin for MockStream<I> where
I: Unpin,
I: Unpin,
impl<I> UnwindSafe for MockStream<I> where
I: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,