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: &Value) -> String
pub fn row_title(&self, row: &Value) -> 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: &Value) -> String
pub fn detail_title(&self, row: &Value) -> String
A detail sheet’s title for a row: its value at the sheet’s title key, else the row’s title.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Records
impl<'de> Deserialize<'de> for Records
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Records, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Records, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Records
impl Serialize for Records
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Records
Auto Trait Implementations§
impl Freeze for Records
impl RefUnwindSafe for Records
impl Send for Records
impl Sync for Records
impl Unpin for Records
impl UnsafeUnpin for Records
impl UnwindSafe for Records
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more