pub struct Records {
pub meta: Meta,
pub source: RecordSource,
pub key: String,
pub title_key: Option<String>,
pub subtitle_key: Option<String>,
pub columns: Vec<Column>,
pub tone_key: Option<String>,
pub row_fields: Vec<RowField>,
pub row_actions: Vec<Action>,
pub empty: Option<Empty>,
pub refresh: Vec<String>,
pub detail: Option<Detail>,
}Expand description
A record list or table: rows read from a source, each with its
actions (${row.<key>} in their arguments).
Fields§
§meta: Meta§source: RecordSource§key: StringThe record’s id (its key in a row action’s ${row.<key>}).
title_key: Option<String>A list: the title and subtitle keys; a table: unused.
subtitle_key: Option<String>§columns: Vec<Column>A table’s columns; a list’s trailing values.
tone_key: Option<String>A key whose value (info, success, warning, danger, muted) tones
the row.
row_fields: Vec<RowField>§row_actions: Vec<Action>§empty: Option<Empty>§refresh: Vec<String>Event kinds after which it is read again (storage.*).
detail: Option<Detail>A row’s detail sheet: a Details button on each row opens it.
Implementations§
Source§impl Records
impl Records
Sourcepub fn command(
id: &str,
title: &str,
command: &str,
pointer: &str,
key: &str,
) -> Records
pub fn command( id: &str, title: &str, command: &str, pointer: &str, key: &str, ) -> Records
Records a read_only command answers (an array at pointer).
Sourcepub fn hook(id: &str, title: &str, hook: &str, key: &str) -> Records
pub fn hook(id: &str, title: &str, hook: &str, key: &str) -> Records
Records a records hook gives.
Sourcepub fn titles(self, title: &str, subtitle: Option<&str>) -> Records
pub fn titles(self, title: &str, subtitle: Option<&str>) -> Records
A list item’s title and subtitle keys.
pub fn column(self, key: &str, title: &str) -> Records
Sourcepub fn meter(self, key: &str, title: &str, text: &str) -> Records
pub fn meter(self, key: &str, title: &str, text: &str) -> Records
A meter column: the share at key (0 to 1), the words at text.
Sourcepub fn icon(self, key: &str, title: &str, tip: Option<&str>) -> Records
pub fn icon(self, key: &str, title: &str, tip: Option<&str>) -> Records
An icon column: the IconCell at key, its tooltip (when the
value is a bare name) at tip.
Sourcepub fn field_for(&self, key: &str) -> Option<&RowField>
pub fn field_for(&self, key: &str) -> Option<&RowField>
The row field shown in place of a column, by its key.
Sourcepub fn extra_fields(&self) -> impl Iterator<Item = &RowField>
pub fn extra_fields(&self) -> impl Iterator<Item = &RowField>
The row fields with no column of their key: a table adds a column for each.
pub fn tone(self, key: &str) -> Records
pub fn row_action(self, action: Action) -> Records
pub fn empty(self, text: &str, action: Option<Action>) -> Records
pub fn refresh(self, event: &str) -> Records
Sourcepub fn detail(self, detail: Detail) -> Records
pub fn detail(self, detail: Detail) -> Records
A detail sheet for each row (Detail): a Details button on the
row opens it.
Sourcepub fn row_title(&self, row: &Json) -> String
pub fn row_title(&self, row: &Json) -> String
A row’s title: its value at the list’s title key, else at the first column’s key, else its id.
Sourcepub fn detail_title(&self, row: &Json) -> String
pub fn detail_title(&self, row: &Json) -> String
A detail sheet’s title for a row: its value at the sheet’s title key, else the row’s title.
Sourcepub fn rows_of(answer: &Json, pointer: &str) -> Vec<Json>
pub fn rows_of(answer: &Json, pointer: &str) -> Vec<Json>
The rows in a source’s answer: the array at the pointer, its objects only; an object there is one record (a form over one record, as a strategy).
Sourcepub fn row_values(values: &Values, row: &Json) -> Values
pub fn row_values(values: &Values, row: &Json) -> Values
The values a row’s actions and fields read: the form’s, and the
record’s as row.<key>.