pub struct RawStyle { /* private fields */ }
Expand description
A raw style data, which can be produced safely from Style
.
It can be useful in order to not have a generics and be able to use it as a variable more conveniently.
Implementations§
Source§impl RawStyle
impl RawStyle
Sourcepub fn set_bottom(&mut self, s: Option<char>) -> &mut Self
pub fn set_bottom(&mut self, s: Option<char>) -> &mut Self
Set a bottom border character.
Sourcepub fn set_top_split(&mut self, s: Option<char>) -> &mut Self
pub fn set_top_split(&mut self, s: Option<char>) -> &mut Self
Set a top split border character.
Sourcepub fn set_bottom_split(&mut self, s: Option<char>) -> &mut Self
pub fn set_bottom_split(&mut self, s: Option<char>) -> &mut Self
Set a bottom split character.
Sourcepub fn set_left_split(&mut self, s: Option<char>) -> &mut Self
pub fn set_left_split(&mut self, s: Option<char>) -> &mut Self
Set a left split character.
Sourcepub fn set_right_split(&mut self, s: Option<char>) -> &mut Self
pub fn set_right_split(&mut self, s: Option<char>) -> &mut Self
Set a right split character.
Sourcepub fn set_internal_split(&mut self, s: Option<char>) -> &mut Self
pub fn set_internal_split(&mut self, s: Option<char>) -> &mut Self
Set an internal character.
Sourcepub fn set_vertical(&mut self, s: Option<char>) -> &mut Self
pub fn set_vertical(&mut self, s: Option<char>) -> &mut Self
Set a vertical character.
Sourcepub fn set_horizontal(&mut self, s: Option<char>) -> &mut Self
pub fn set_horizontal(&mut self, s: Option<char>) -> &mut Self
Set a horizontal character.
Sourcepub fn set_top_left(&mut self, s: Option<char>) -> &mut Self
pub fn set_top_left(&mut self, s: Option<char>) -> &mut Self
Set a character for a top left corner.
Sourcepub fn set_top_right(&mut self, s: Option<char>) -> &mut Self
pub fn set_top_right(&mut self, s: Option<char>) -> &mut Self
Set a character for a top right corner.
Sourcepub fn set_bottom_left(&mut self, s: Option<char>) -> &mut Self
pub fn set_bottom_left(&mut self, s: Option<char>) -> &mut Self
Set a character for a bottom left corner.
Sourcepub fn set_bottom_right(&mut self, s: Option<char>) -> &mut Self
pub fn set_bottom_right(&mut self, s: Option<char>) -> &mut Self
Set a character for a bottom right corner.
Sourcepub fn set_horizontals(&mut self, lines: HashMap<usize, Line>) -> &mut Self
pub fn set_horizontals(&mut self, lines: HashMap<usize, Line>) -> &mut Self
Set horizontal border lines.
§Example
use std::collections::HashMap;
use tabled::{style::{Style, Line, RawStyle}, TableIteratorExt};
let mut style = RawStyle::from(Style::re_structured_text());
let mut lines = HashMap::new();
lines.insert(1, Style::extended().get_horizontal());
style.set_horizontals(lines);
let table = (0..3)
.map(|i| ("Hello", i))
.table()
.with(style)
.to_string();
assert_eq!(
table,
concat!(
" ======= ===== \n",
" &str i32 \n",
"╠═══════╬═════╣\n",
" Hello 0 \n",
" Hello 1 \n",
" Hello 2 \n",
" ======= ===== ",
),
)
Sourcepub fn set_verticals(&mut self, lines: HashMap<usize, Line>) -> &mut Self
pub fn set_verticals(&mut self, lines: HashMap<usize, Line>) -> &mut Self
Set vertical border lines.
§Example
use std::collections::HashMap;
use tabled::{style::{Style, Line, RawStyle}, TableIteratorExt};
let mut style = RawStyle::from(Style::re_structured_text());
let mut lines = HashMap::new();
lines.insert(1, Style::extended().get_horizontal());
style.set_verticals(lines);
let table = (0..3)
.map(|i| ("Hello", i))
.table()
.with(style)
.to_string();
assert_eq!(
table,
concat!(
"=======╠=====\n",
" &str ═ i32 \n",
"======= =====\n",
" Hello ═ 0 \n",
" Hello ═ 1 \n",
" Hello ═ 2 \n",
"=======╣=====",
),
)
Sourcepub fn get_left_intersection(&self) -> Option<char>
pub fn get_left_intersection(&self) -> Option<char>
Get a left intersection char.
Sourcepub fn get_right_intersection(&self) -> Option<char>
pub fn get_right_intersection(&self) -> Option<char>
Get a right intersection char.
Sourcepub fn get_top_left(&self) -> Option<char>
pub fn get_top_left(&self) -> Option<char>
Get a top left char.
Sourcepub fn get_top_right(&self) -> Option<char>
pub fn get_top_right(&self) -> Option<char>
Get a top right char.
Sourcepub fn get_top_intersection(&self) -> Option<char>
pub fn get_top_intersection(&self) -> Option<char>
Get a top intersection char.
Sourcepub fn get_bottom(&self) -> Option<char>
pub fn get_bottom(&self) -> Option<char>
Get a bottom intersection char.
Sourcepub fn get_bottom_left(&self) -> Option<char>
pub fn get_bottom_left(&self) -> Option<char>
Get a bottom intersection char.
Sourcepub fn get_bottom_right(&self) -> Option<char>
pub fn get_bottom_right(&self) -> Option<char>
Get a bottom intersection char.
Sourcepub fn get_bottom_intersection(&self) -> Option<char>
pub fn get_bottom_intersection(&self) -> Option<char>
Get a bottom intersection char.