#[non_exhaustive]pub struct EntityInfo {Show 23 fields
pub name: String,
pub caption: String,
pub navigation: Option<String>,
pub icon: Option<String>,
pub fields: Vec<FieldInfo>,
pub rules: Vec<Rule>,
pub appearance: Vec<AppearanceRule>,
pub variants: Vec<ViewVariant>,
pub description: Option<String>,
pub state_machines: Vec<StateMachine>,
pub reminder: Option<Reminder>,
pub actions: Vec<RecordAction>,
pub editor_settings: Vec<(String, String, String)>,
pub form_columns: Option<u8>,
pub filters: Vec<ListFilter>,
pub list_criteria: Option<String>,
pub cloneable: bool,
pub transient: bool,
pub checks_on_leave: bool,
pub list_editable: bool,
pub data_access: DataAccess,
pub form_actions: Vec<String>,
pub focus_order: Vec<String>,
}Expand description
A kind of record.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIts name, in the model and in code.
caption: StringWhat people see. Follows from the name unless given.
The group it goes under in the navigation; without one, it stays out.
icon: Option<String>The name of its icon.
fields: Vec<FieldInfo>Its fields, in the order they were declared.
rules: Vec<Rule>What its records have to meet.
appearance: Vec<AppearanceRule>How things look and behave by what its records hold.
variants: Vec<ViewVariant>The ways to see its list.
description: Option<String>What its list says it is there for, above the records.
state_machines: Vec<StateMachine>The states its records go through.
reminder: Option<Reminder>When to remind people of a record.
actions: Vec<RecordAction>Actions that set fields of the records selected.
editor_settings: Vec<(String, String, String)>What the list editors are told about this list: an editor’s settings node, and in it names and values.
form_columns: Option<u8>How many columns its form’s fields go in; by how many there are, unless given.
filters: Vec<ListFilter>The filters people pick from on its list.
list_criteria: Option<String>What every record its list shows has to meet.
cloneable: boolIts records can be cloned.
transient: boolIts records are not kept by any storage: they live on a form or in a list given to them.
checks_on_leave: boolA form says what is wrong with a field as it is left, and not only on saving.
list_editable: boolPeople can change values right on its list.
data_access: DataAccessHow its list gets its records.
form_actions: Vec<String>Places on its form for actions, by the name of their ActionCategory::InForm.
focus_order: Vec<String>The fields its form goes through first with the keyboard, in this order. The form shows them in the same order, so the eye and the keyboard go the same way.
Implementations§
Source§impl EntityInfo
impl EntityInfo
Sourcepub fn appearance_of(
&self,
target: AppearanceTarget,
name: &str,
view: &ViewInfo,
object: Option<&Object>,
) -> Appearance
pub fn appearance_of( &self, target: AppearanceTarget, name: &str, view: &ViewInfo, object: Option<&Object>, ) -> Appearance
What this entity’s rules say about a thing in a view, for a record.
Source§impl EntityInfo
impl EntityInfo
The group it goes under in the navigation.
Sourcepub fn appearance(self, rule: AppearanceRule) -> Self
pub fn appearance(self, rule: AppearanceRule) -> Self
Appends a rule about how things look.
Sourcepub fn filter(self, filter: ListFilter) -> Self
pub fn filter(self, filter: ListFilter) -> Self
Appends a filter people pick from on its list.
Sourcepub fn list_criteria(self, expression: impl Into<String>) -> Self
pub fn list_criteria(self, expression: impl Into<String>) -> Self
What every record its list shows has to meet.
Sourcepub fn transient(self) -> Self
pub fn transient(self) -> Self
Its records are not kept by any storage: they live on a form or in a list given to them.
Sourcepub fn checks_on_leave(self) -> Self
pub fn checks_on_leave(self) -> Self
A form says what is wrong with a field as it is left, and not only on saving.
Sourcepub fn list_editable(self) -> Self
pub fn list_editable(self) -> Self
People can change values right on its list, with the rules checked as they do.
Sourcepub fn data_access(self, access: DataAccess) -> Self
pub fn data_access(self, access: DataAccess) -> Self
How its list gets its records.
Sourcepub fn form_actions(self, name: impl Into<String>) -> Self
pub fn form_actions(self, name: impl Into<String>) -> Self
A place on its form for the actions of ActionCategory::InForm with this name.
Sourcepub fn focus_order(
self,
fields: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn focus_order( self, fields: impl IntoIterator<Item = impl Into<String>>, ) -> Self
The fields its form goes through first with the keyboard, in this order; the others follow in the order they were declared. The form shows them in the same order.
Sourcepub fn form_columns(self, columns: u8) -> Self
pub fn form_columns(self, columns: u8) -> Self
How many columns its form’s fields go in.
Sourcepub fn description(self, text: impl Into<String>) -> Self
pub fn description(self, text: impl Into<String>) -> Self
What its list says it is there for, above the records.
Sourcepub fn state_machine(self, machine: StateMachine) -> Self
pub fn state_machine(self, machine: StateMachine) -> Self
Gives its records states, and only these ways between them. Its field becomes read-only on forms and starts in the machine’s first state, its actions come by themselves, and any other change is refused when it is kept. Declare the field first.
Sourcepub fn state_appearance(
self,
field: &str,
state: &str,
rule: AppearanceRule,
) -> Self
pub fn state_appearance( self, field: &str, state: &str, rule: AppearanceRule, ) -> Self
An appearance that holds while its field is in this state.
Sourcepub fn action(self, action: RecordAction) -> Self
pub fn action(self, action: RecordAction) -> Self
An action that sets fields of the records selected. It comes by itself on its list and its form.
Sourcepub fn editor_setting(
self,
node: impl Into<String>,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn editor_setting( self, node: impl Into<String>, name: impl Into<String>, value: impl Into<String>, ) -> Self
Tells a list editor something about its list, as ChartSettings, Kind and Line. It goes
in the model under the list’s view, so a person can change it like any other setting.
Sourcepub fn variant(self, variant: ViewVariant) -> Self
pub fn variant(self, variant: ViewVariant) -> Self
Appends a way to see its list.
Sourcepub fn field_named(&self, name: &str) -> Option<&FieldInfo>
pub fn field_named(&self, name: &str) -> Option<&FieldInfo>
A field by name.
Sourcepub fn default_property(&self) -> Option<&FieldInfo>
pub fn default_property(&self) -> Option<&FieldInfo>
The field that names a record: the first in lookups, or else the first with text.
Sourcepub fn check(&self) -> Result<(), ModelError>
pub fn check(&self) -> Result<(), ModelError>
Says what is wrong with how it was declared.
Sourcepub fn new_object(&self) -> Object
pub fn new_object(&self) -> Object
A record of this entity with what a new one starts with.
Sourcepub fn compute(&self, object: &mut Object, environment: &Environment)
pub fn compute(&self, object: &mut Object, environment: &Environment)
Fills in the calculated fields, in the order declared, so one can read another.
Sourcepub fn strip_calculated(&self, object: &mut Object)
pub fn strip_calculated(&self, object: &mut Object)
The object as it is stored, with no calculated values.
Trait Implementations§
Source§impl Clone for EntityInfo
impl Clone for EntityInfo
Source§fn clone(&self) -> EntityInfo
fn clone(&self) -> EntityInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more