[−][src]Struct comfy_table::Cell
A stylable table cell with content.
Implementations
impl Cell
[src]
pub fn new<T: ToString>(content: T) -> Self
[src]
Create a new Cell
pub fn get_content(&self) -> String
[src]
Return a copy of the content contained in this cell.
pub fn set_delimiter(mut self: Self, delimiter: char) -> Self
[src]
Set the delimiter used to split text for this cell
pub fn set_alignment(mut self: Self, alignment: CellAlignment) -> Self
[src]
Set the alignment of content for this cell.
Setting this overwrites alignment settings of the Column for this specific cell.
use comfy_table::CellAlignment; use comfy_table::Cell; let mut cell = Cell::new("Some content") .set_alignment(CellAlignment::Center);
pub fn fg(mut self: Self, color: Color) -> Self
[src]
Set the foreground text color for this cell.
comfy-table uses Crossterm Colors. Look at their documentation for all possible Colors.
use comfy_table::Color; use comfy_table::Cell; let mut cell = Cell::new("Some content") .fg(Color::Red);
pub fn bg(mut self: Self, color: Color) -> Self
[src]
Set the background color for this cell.
comfy-table uses Crossterm Colors. Look at their documentation for all possible Colors.
use comfy_table::Color; use comfy_table::Cell; let mut cell = Cell::new("Some content") .bg(Color::Red);
pub fn add_attribute(mut self: Self, attribute: Attribute) -> Self
[src]
Add a styling attribute to the content cell.
Those can be bold, italic, blinking and many more.
comfy-table uses Crossterm Attributes. Look at their documentation for all possible Attributes.
use comfy_table::Attribute; use comfy_table::Cell; let mut cell = Cell::new("Some content") .add_attribute(Attribute::Bold);
pub fn add_attributes(mut self: Self, mut attribute: Vec<Attribute>) -> Self
[src]
Same as add_attribute, but you can pass a vector of Attributes
Trait Implementations
impl Clone for Cell
[src]
impl Debug for Cell
[src]
impl<T: ToString> From<T> for Cell
[src]
impl ToCell for Cell
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cell
[src]
impl Send for Cell
[src]
impl Sync for Cell
[src]
impl Unpin for Cell
[src]
impl UnwindSafe for Cell
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,