Skip to main content

ColumnType

Trait ColumnType 

Source
pub trait ColumnType:
    Send
    + Sync
    + 'static {
    // Required methods
    fn view_key(&self) -> &'static str;
    fn view_model(&self, cx: &CellCx<'_>) -> CellVm;
    fn render_default(&self, vm: &CellVm) -> Markup;

    // Provided methods
    fn option_keys(&self) -> Option<Vec<&'static str>> { ... }
    fn assets(&self) -> Vec<&'static str> { ... }
}
Expand description

A column type: how a list cell renders. The list counterpart of a field type, sharing Markup and the override resolver (Surface::Column).

Required Methods§

Source

fn view_key(&self) -> &'static str

Source

fn view_model(&self, cx: &CellCx<'_>) -> CellVm

Source

fn render_default(&self, vm: &CellVm) -> Markup

Provided Methods§

Source

fn option_keys(&self) -> Option<Vec<&'static str>>

The keys this type reads from a column’s entry, beyond the ones every column has. A key outside the list is refused when the file is read. None accepts any key unchecked; declare yours.

Source

fn assets(&self) -> Vec<&'static str>

Asset-registry keys this column’s cell needs (a heavy cell widget). The page shell collects and emits them; keys must exist in the registry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§