use crate::wrap::{column_width, split_sublines, wrap, Alignment, Subline, WrappedCell}; use nu_ansi_term::{Color, Style}; use std::collections::HashMap; use std::fmt::Write; enum SeparatorPosition { Top, Middle, Bottom, } #[derive(Debug)] pub struct Table { pub headers: Vec, pub data: Vec>, pub theme: Theme, } #[derive(Debug, Clone)] pub struct StyledString { pub contents: String, pub style: TextStyle, } impl StyledString { pub fn new(contents: String, style: TextStyle) -> StyledString { StyledString { contents, style } } pub fn set_style(&mut self, style: TextStyle) { self.style = style; } } #[derive(Debug, Clone, Copy)] pub struct TextStyle { pub alignment: Alignment, pub color_style: Option