Column

Struct Column 

Source
pub struct Column<T> { /* private fields */ }
Expand description

Configure how we want to display a single column.

Implementations§

Source§

impl<T> Column<T>

Source

pub fn new<F>(func: F) -> Self
where F: Fn(&mut Formatter<'_>, &T) -> Result + 'static,

Create a new Column with a Fn that knows how to extract one column of data from T.

Source

pub fn header(self, name: &str) -> Self

Set a column header.

Note: This will increase the min_width of your column to the size of the header.

Source

pub fn min_width(self, min_width: usize) -> Self

Set the minimum width of the column. (Default: 1)

Note that setting widths of columns larger than the Stream.max_width will cause the stream to expand its max_width to accomodate them.

Source

pub fn left(self) -> Self

Align left. (This is the default.)

Source

pub fn right(self) -> Self

Align right.

Source

pub fn center(self) -> Self

Center-align.

Auto Trait Implementations§

§

impl<T> Freeze for Column<T>

§

impl<T> !RefUnwindSafe for Column<T>

§

impl<T> !Send for Column<T>

§

impl<T> !Sync for Column<T>

§

impl<T> Unpin for Column<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Column<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.