[−][src]Struct term_table::table_cell::TableCell
A table cell containing some str data.
A cell may span multiple columns by setting the value of col_span
.
pad_content
will add a space to either side of the cell's content.AsRef
Fields
data: Cow<'data, str>
col_span: usize
alignment: Alignment
pad_content: bool
Methods
impl<'data> TableCell<'data>
[src]
impl<'data> TableCell<'data>
pub fn new<T>(data: T) -> TableCell<'data> where
T: ToString,
[src]
pub fn new<T>(data: T) -> TableCell<'data> where
T: ToString,
pub fn new_with_col_span<T>(data: T, col_span: usize) -> TableCell<'data> where
T: ToString,
[src]
pub fn new_with_col_span<T>(data: T, col_span: usize) -> TableCell<'data> where
T: ToString,
pub fn new_with_alignment<T>(
data: T,
col_span: usize,
alignment: Alignment
) -> TableCell<'data> where
T: ToString,
[src]
pub fn new_with_alignment<T>(
data: T,
col_span: usize,
alignment: Alignment
) -> TableCell<'data> where
T: ToString,
pub fn new_with_alignment_and_padding<T>(
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> TableCell<'data> where
T: ToString,
[src]
pub fn new_with_alignment_and_padding<T>(
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> TableCell<'data> where
T: ToString,
pub fn width(&self) -> usize
[src]
pub fn width(&self) -> usize
Calculates the width of the cell.
New line characters are taken into account during the calculation.
pub fn split_width(&self) -> f32
[src]
pub fn split_width(&self) -> f32
The width of the cell's content divided by its col_span
value.
pub fn min_width(&self) -> usize
[src]
pub fn min_width(&self) -> usize
The minium width required to display the cell properly
pub fn wrapped_content(&self, width: usize) -> Vec<String>
[src]
pub fn wrapped_content(&self, width: usize) -> Vec<String>
Wraps the cell's content to the provided width.
New line characters are taken into account.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T