Skip to main content

Records

Struct Records 

Source
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: String

The 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

Source

pub fn command( id: &str, title: &str, command: &str, pointer: &str, key: &str, ) -> Records

Records a read_only command answers (an array at pointer).

Source

pub fn hook(id: &str, title: &str, hook: &str, key: &str) -> Records

Records a records hook gives.

Source

pub fn args(self, args: Value) -> Records

The read command’s arguments.

Source

pub fn titles(self, title: &str, subtitle: Option<&str>) -> Records

A list item’s title and subtitle keys.

Source

pub fn column(self, key: &str, title: &str) -> Records

Source

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.

Source

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.

Source

pub fn row_field(self, field: RowField) -> Records

An editable cell (RowField).

Source

pub fn field_for(&self, key: &str) -> Option<&RowField>

The row field shown in place of a column, by its key.

Source

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.

Source

pub fn tone(self, key: &str) -> Records

Source

pub fn row_action(self, action: Action) -> Records

Source

pub fn empty(self, text: &str, action: Option<Action>) -> Records

Source

pub fn refresh(self, event: &str) -> Records

Source

pub fn detail(self, detail: Detail) -> Records

A detail sheet for each row (Detail): a Details button on the row opens it.

Source

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.

Source

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.

Source

pub fn rows_of(answer: &Value, pointer: &str) -> Vec<Value>

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).

Source

pub fn row_values( values: &BTreeMap<String, Value>, row: &Value, ) -> BTreeMap<String, Value>

The values a row’s actions and fields read: the form’s, and the record’s as row.<key>.

Trait Implementations§

Source§

impl Clauses for Records

Source§

fn meta_mut(&mut self) -> &mut Meta

Source§

fn when(self, clause: &str) -> Self

Shown only when the clause holds (the when language; the section’s values as form.<field id>).
Source§

fn enabled(self, clause: &str, reason: &str) -> Self

Greyed, with its reason, when the clause does not hold.
Source§

impl Clone for Records

Source§

fn clone(&self) -> Records

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Records

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Records

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Records, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Records

Source§

fn eq(&self, other: &Records) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Records

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Records

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,