use std::ops::Index; use types::SqlValue; /// Represents a row of data returned from a SQL query. /// #[derive(Debug)] pub struct Row { columns: Vec, } impl Row { pub(crate) fn new(columns: Vec) -> Row { Row { columns: columns } } /// Returns the columns in the row. /// pub fn columns(&self) -> &[SqlValue] { &self.columns } } impl Index for Row { type Output = SqlValue; fn index(&self, index: usize) -> &SqlValue { &self.columns[index] } }