use crate::chopper::error::Result;
use crate::chopper::types::Row;
use crate::sink::sink::Sink;

pub struct VecSink {
    pub rows: Vec<Box<Row>>,
}

impl VecSink {
    pub fn new() -> VecSink {
        VecSink { rows: Vec::new() }
    }
}

impl Sink for VecSink {
    fn write(&mut self, row: Box<Row>) -> Result<()> {
        self.rows.push(row);
        Ok(())
    }
}
