pub struct Aggregator<T, I, O>where
    T: Accumulate<I, O>,
    I: FromStr,
    O: Display,{ /* private fields */ }
Expand description

The object that computes the aggregations and writes to standard output.

Implementations§

source§

impl<T, I, O> Aggregator<T, I, O>where T: Accumulate<I, O>, I: FromStr, O: Display,

source

pub fn new( index_cols: Vec<usize>, column_cols: Vec<usize>, values_col: usize, skip_null: bool, row_order: OutputOrder, column_order: OutputOrder, parsing_strategy: ParsingStrategy ) -> Aggregator<T, I, O>

source

pub fn aggregate<R: Read>(&mut self, rdr: &mut Reader<R>) -> CsvCliResult<()>

Takes a CSV (from anything that impl’s Read) and aggregates information from the struct’s settings. Does not write anything.

source

pub fn to_vec(&self) -> Vec<Vec<String>>

Writes the aggregated information into a list of records

source

pub fn write_results<W: Write>( &mut self, writer: &mut Writer<W> ) -> CsvCliResult<()>

Writes the aggregated information to standard output.

Trait Implementations§

source§

impl<T, I, O> Debug for Aggregator<T, I, O>where T: Accumulate<I, O> + Debug, I: FromStr + Debug, O: Display + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, I, O> PartialEq<Aggregator<T, I, O>> for Aggregator<T, I, O>where T: Accumulate<I, O> + PartialEq, I: FromStr + PartialEq, O: Display + PartialEq,

source§

fn eq(&self, other: &Aggregator<T, I, O>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, I, O> StructuralPartialEq for Aggregator<T, I, O>where T: Accumulate<I, O>, I: FromStr, O: Display,

Auto Trait Implementations§

§

impl<T, I, O> RefUnwindSafe for Aggregator<T, I, O>where I: RefUnwindSafe, O: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, I, O> Send for Aggregator<T, I, O>where I: Send, O: Send, T: Send,

§

impl<T, I, O> Sync for Aggregator<T, I, O>where I: Sync, O: Sync, T: Sync,

§

impl<T, I, O> Unpin for Aggregator<T, I, O>where I: Unpin, O: Unpin, T: Unpin,

§

impl<T, I, O> UnwindSafe for Aggregator<T, I, O>where I: UnwindSafe, O: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.