[−][src]Struct comfy_table::styling::table::TableStyle
This struct wraps the various styling options for a table
The default style preset when using ::new is the ASCII_FULL
Methods
impl TableStyle[src]
pub fn new() -> Self[src]
Create a new TableStyle. The default style is ASCII_FULL,
pub fn load_preset(&mut self, preset: &str)[src]
This function creates a TableStyle from a given preset string. Preset strings can be found in styling::presets::*
Anyway, you can write your own preset strings and use them with this function. The function expects a characters for components to be in the same order as in the Component enum.
If the string isn't long enough, the default ASCII_FULL style will be used for all remaining components.
If the string is too long, remaining charaacters will be simply ignored.
pub fn apply_modifier(&mut self, modifier: &str) -> &mut Self[src]
Modify a preset with a modifier string from modifiers. For instance, the UTF8_ROUND_CORNERS modifies all corners to be round UTF8 box corners.
pub fn set_style(
&mut self,
component: Component,
character: Option<char>
) -> &mut Self[src]
&mut self,
component: Component,
character: Option<char>
) -> &mut Self
Define the char that will be used to draw a specific component Look at Component to see all stylable Components
If None is supplied, the element won't be displayed.
In case of a e.g. *BorderIntersection a whitespace will be used as placeholder,
unless related borders and and corners are set to None as well.
For example, if TopBorderIntersections is None the first row would look like this:
+------ ------+
| asdf | ghij |
If in addition TopLeftCorner,TopBorder and TopRightCorner would be None as well,
the first line wouldn't be displayed at all.
pub fn get_style(&mut self, component: Component) -> Option<char>[src]
Get a copy of the char currently used for drawing a specific component
pub fn style_or_default(&self, component: Component) -> String[src]
pub fn style_exists(&self, component: Component) -> bool[src]
Auto Trait Implementations
impl RefUnwindSafe for TableStyle
impl Send for TableStyle
impl Sync for TableStyle
impl Unpin for TableStyle
impl UnwindSafe for TableStyle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,