Struct term_table::table_cell::TableCell [−][src]
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
Implementations
impl<'data> TableCell<'data>
[src]
pub fn new<T>(data: T) -> TableCell<'data> where
T: ToString,
[src]
T: ToString,
pub fn new_with_col_span<T>(data: T, col_span: usize) -> TableCell<'data> where
T: ToString,
[src]
T: ToString,
pub fn new_with_alignment<T>(
data: T,
col_span: usize,
alignment: Alignment
) -> TableCell<'data> where
T: ToString,
[src]
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]
data: T,
col_span: usize,
alignment: Alignment,
pad_content: bool
) -> TableCell<'data> where
T: ToString,
pub fn width(&self) -> usize
[src]
Calculates the width of the cell.
New line characters are taken into account during the calculation.
pub fn split_width(&self) -> f32
[src]
The width of the cell's content divided by its col_span
value.
pub fn min_width(&self) -> usize
[src]
The minium width required to display the cell properly
pub fn wrapped_content(&self, width: usize) -> Vec<String>
[src]
Wraps the cell's content to the provided width.
New line characters are taken into account.
Trait Implementations
impl<'data> Clone for TableCell<'data>
[src]
impl<'data> Debug for TableCell<'data>
[src]
impl<'data, T> From<T> for TableCell<'data> where
T: ToString,
[src]
T: ToString,
Auto Trait Implementations
impl<'data> RefUnwindSafe for TableCell<'data>
[src]
impl<'data> Send for TableCell<'data>
[src]
impl<'data> Sync for TableCell<'data>
[src]
impl<'data> Unpin for TableCell<'data>
[src]
impl<'data> UnwindSafe for TableCell<'data>
[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>,