Skip to main content

TableColumn

Struct TableColumn 

Source
pub struct TableColumn<T: 'static> { /* private fields */ }
Expand description

A column of a Table: its header’s title, and the view each row shows in its cell.

ⓘ
TableColumn::new("Size", |entry: Entry| Text::new(human_size(entry.size)))
    .width(80)
    .sort_key(SortBy::Size)

Implementations§

Source§

impl<T: 'static> TableColumn<T>

Source

pub fn new<V: View>( title: impl IntoValue<String>, render: impl Fn(T) -> V + 'static, ) -> TableColumn<T>

title can be a message (t!), which follows the language.

Source

pub fn width(self, width: impl Into<Length>) -> TableColumn<T>

How wide it starts; the user can resize it, as the platform lets them. Without, it’s as wide as the platform makes a column.

Source

pub fn expand(self) -> TableColumn<T>

Takes the room the table has past its columns’ widths, shared with the other columns that do: a file’s name, say.

Source

pub fn fills_row(self) -> TableColumn<T>

Its cells fill their row: as wide as the column and as high as the row, without the space the platform puts around a cell’s content, for drawings that join from row to row (a commit graph). The row is as high as the platform makes it, which is the platform’s own row height on some (GTK’s, WinUI’s are higher than AppKit’s), so draw to the cell’s size rather than a fixed one.

Source

pub fn sort_key<S: PartialEq + Clone + 'static>(self, key: S) -> TableColumn<T>

Makes the column sortable: pressing its header sorts the table by this key, which the table’s sort signal holds. The key is of the signal’s type.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for TableColumn<T>

§

impl<T> !Send for TableColumn<T>

§

impl<T> !Sync for TableColumn<T>

§

impl<T> !UnwindSafe for TableColumn<T>

§

impl<T> Forget for TableColumn<T>

§

impl<T> Freeze for TableColumn<T>
where Rc<dyn Fn(T) -> AnyView>: Freeze,

§

impl<T> Move for TableColumn<T>

§

impl<T> Unpin for TableColumn<T>
where Rc<dyn Fn(T) -> AnyView>: Unpin,

§

impl<T> UnsafeUnpin for TableColumn<T>
where Rc<dyn Fn(T) -> AnyView>: UnsafeUnpin,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.