mssqlrust 1.0.2

Lightweight Rust library for Microsoft SQL Server using dataset and datatable
Documentation
use std::ops::Index;

use super::{DataColumn, DataRow};

#[derive(Debug, Clone, PartialEq, Default)]
pub struct DataTable {
    pub name: String,
    pub columns: Vec<DataColumn>,
    pub rows: Vec<DataRow>,
}

impl DataTable {
    pub fn new(name: &str) -> Self {
        Self {
            name: name.into(),
            columns: Vec::new(),
            rows: Vec::new(),
        }
    }
}

impl Index<usize> for DataTable {
    type Output = DataRow;

    fn index(&self, index: usize) -> &Self::Output {
        &self.rows[index]
    }
}