RelmColumn

Trait RelmColumn 

Source
pub trait RelmColumn: Any {
    type Root: IsA<Widget>;
    type Widgets;
    type Item: Any;

    const COLUMN_NAME: &'static str;
    const ENABLE_RESIZE: bool = false;
    const ENABLE_EXPAND: bool = false;

    // Required method
    fn setup(list_item: &ListItem) -> (Self::Root, Self::Widgets);

    // Provided methods
    fn header_title() -> String { ... }
    fn bind(
        _item: &mut Self::Item,
        _widgets: &mut Self::Widgets,
        _root: &mut Self::Root,
    ) { ... }
    fn unbind(
        _item: &mut Self::Item,
        _widgets: &mut Self::Widgets,
        _root: &mut Self::Root,
    ) { ... }
    fn teardown(_list_item: &ListItem) { ... }
    fn sort_fn() -> OrdFn<Self::Item> { ... }
}
Expand description

An item of a TypedColumnView.

Required Associated Constants§

Source

const COLUMN_NAME: &'static str

The columns created for this list item.

Provided Associated Constants§

Source

const ENABLE_RESIZE: bool = false

Whether to enable resizing for this column

Source

const ENABLE_EXPAND: bool = false

Whether to enable automatic expanding for this column

Required Associated Types§

Source

type Root: IsA<Widget>

The top-level widget for the list item.

Source

type Widgets

The widgets created for the list item.

Source

type Item: Any

Item whose data is shown in this column.

Required Methods§

Source

fn setup(list_item: &ListItem) -> (Self::Root, Self::Widgets)

Construct the widgets.

Provided Methods§

Source

fn header_title() -> String

Returns the shown title for the column. By default shows RelmColumn::COLUMN_NAME. Useful for translations

Source

fn bind( _item: &mut Self::Item, _widgets: &mut Self::Widgets, _root: &mut Self::Root, )

Bind the widgets to match the data of the list item.

Source

fn unbind( _item: &mut Self::Item, _widgets: &mut Self::Widgets, _root: &mut Self::Root, )

Undo the steps of RelmColumn::bind() if necessary.

Source

fn teardown(_list_item: &ListItem)

Undo the steps of RelmColumn::setup() if necessary.

Source

fn sort_fn() -> OrdFn<Self::Item>

Sorter for column.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C> RelmColumn for C
where C: LabelColumn,

Source§

const COLUMN_NAME: &'static str = C::COLUMN_NAME

Source§

const ENABLE_RESIZE: bool = C::ENABLE_RESIZE

Source§

const ENABLE_EXPAND: bool = C::ENABLE_EXPAND

Source§

type Root = Label

Source§

type Widgets = ()

Source§

type Item = <C as LabelColumn>::Item