#[non_exhaustive]pub struct FieldInfo {Show 30 fields
pub name: String,
pub caption: String,
pub kind: FieldKind,
pub is_key: bool,
pub read_only: bool,
pub in_list: bool,
pub in_detail: bool,
pub in_lookup: bool,
pub calculated: Option<String>,
pub default_value: Value,
pub editor: Option<String>,
pub placeholder: Option<String>,
pub wide: bool,
pub autofocus: bool,
pub hint: Option<String>,
pub lookup_filter: Option<String>,
pub none_caption: Option<String>,
pub back_reference: Option<String>,
pub non_cloneable: bool,
pub aggregated: bool,
pub most_bytes: Option<u64>,
pub accepted: Vec<String>,
pub group: Option<String>,
pub display_format: Option<String>,
pub edit_mask: Option<String>,
pub predefined: Vec<String>,
pub criteria_of: Option<String>,
pub secret: bool,
pub accessible_name: Option<String>,
pub accessible_description: Option<String>,
}Expand description
A field of an EntityInfo.
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 expressions and in the model.
caption: StringWhat people see. Follows from the name unless given.
kind: FieldKindWhat it holds.
is_key: boolIt identifies the record.
read_only: boolIt can be seen but not changed.
in_list: boolIt has a column in lists.
in_detail: boolIt is on the form.
in_lookup: boolIt has a column when picking a record of this entity.
calculated: Option<String>An expression that gives its value; nothing is stored.
default_value: ValueWhat a new record starts with.
editor: Option<String>The control that edits it, by name, instead of the one for its kind.
placeholder: Option<String>What an empty editor shows.
wide: boolIt takes the whole width of its group on a form.
autofocus: boolTakes the keyboard when its form opens.
hint: Option<String>What the form says under it.
lookup_filter: Option<String>For a reference: what its records have to meet, where ?field is the value of that field
of the record being edited.
none_caption: Option<String>For a reference that can be left empty and is picked from a list: what empty is called.
back_reference: Option<String>For a collection: the field of the other entity that points back here, when it has more than one reference to this entity.
non_cloneable: boolIt stays behind when a record is cloned.
aggregated: boolFor a collection: its records belong to this one, and are cloned with it.
most_bytes: Option<u64>For a picture or a file: the largest taken, in bytes.
accepted: Vec<String>For a file: the extensions offered; none means any.
group: Option<String>The titled group it goes in on a form, away from the other fields.
display_format: Option<String>How its value shows when it is not being edited: {} is the value, {:.2} a number with
these decimals, and {:dd/MM/yyyy HH:mm} a date.
edit_mask: Option<String>For text: the mask it is typed through, where 0 is a digit, A a letter and * anything.
predefined: Vec<String>For text: the values offered to pick from.
criteria_of: Option<String>For an expression: the entity whose fields it can be about, which gives it a filter builder.
secret: boolIt never leaves storage through a secured space, for anyone, and no screen shows it.
accessible_name: Option<String>What screen readers call it, when the caption is not enough. The caption by default.
accessible_description: Option<String>What screen readers say after its name, such as what goes in it. The hint by default.
Implementations§
Source§impl FieldInfo
impl FieldInfo
Sourcepub fn new(name: impl Into<String>, kind: FieldKind) -> Self
pub fn new(name: impl Into<String>, kind: FieldKind) -> Self
A field shown in lists and on the form.
Sourcepub fn key(self) -> Self
pub fn key(self) -> Self
Makes it the key: read-only, and out of lists and forms unless told otherwise.
Sourcepub fn default_property(self) -> Self
pub fn default_property(self) -> Self
Makes it what names a record, for EntityInfo::default_property.
Sourcepub fn calculated(self, expression: impl Into<String>) -> Self
pub fn calculated(self, expression: impl Into<String>) -> Self
Gets its value from this expression, read-only and not stored.
Sourcepub fn editor(self, editor: impl Into<String>) -> Self
pub fn editor(self, editor: impl Into<String>) -> Self
The control that edits it, by name: Segmented for options side by side, or one
registered in an editor registry.
Sourcepub fn placeholder(self, text: impl Into<String>) -> Self
pub fn placeholder(self, text: impl Into<String>) -> Self
What an empty editor shows.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
What screen readers call it, instead of its caption: for a caption that only makes sense
next to what is around it, such as Até for the end of a period.
Sourcepub fn accessible_description(self, text: impl Into<String>) -> Self
pub fn accessible_description(self, text: impl Into<String>) -> Self
What screen readers say after its name, instead of its hint.
Sourcepub fn lookup_filter(self, expression: impl Into<String>) -> Self
pub fn lookup_filter(self, expression: impl Into<String>) -> Self
For a reference: what its records have to meet, where ?field is the value of that field
of the record being edited, as in [flow] = ?flow.
Sourcepub fn none_caption(self, caption: impl Into<String>) -> Self
pub fn none_caption(self, caption: impl Into<String>) -> Self
For a reference that can be left empty and is picked from a list: what empty is called.
Sourcepub fn back_reference(self, field: impl Into<String>) -> Self
pub fn back_reference(self, field: impl Into<String>) -> Self
For a collection: the field of the other entity that points back here.
Sourcepub fn non_cloneable(self) -> Self
pub fn non_cloneable(self) -> Self
Stays behind when a record is cloned.
Sourcepub fn aggregated(self) -> Self
pub fn aggregated(self) -> Self
For a collection: its records belong to this one, and are cloned with it.
Sourcepub fn most_bytes(self, bytes: u64) -> Self
pub fn most_bytes(self, bytes: u64) -> Self
For a picture or a file: the largest taken, in bytes.
Sourcepub fn accepted(
self,
extensions: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn accepted( self, extensions: impl IntoIterator<Item = impl Into<String>>, ) -> Self
For a file: the extensions offered, such as pdf.
Sourcepub fn default_value(self, value: impl Into<Value>) -> Self
pub fn default_value(self, value: impl Into<Value>) -> Self
What a new record starts with.
Sourcepub fn group(self, title: impl Into<String>) -> Self
pub fn group(self, title: impl Into<String>) -> Self
Goes in the group with this title on a form, as the parts of one thing do.
Sourcepub fn display_format(self, format: impl Into<String>) -> Self
pub fn display_format(self, format: impl Into<String>) -> Self
How its value shows when it is not being edited: {} is the value, {:.2} a number with
these decimals, and {:dd/MM/yyyy HH:mm} a date.
Sourcepub fn edit_mask(self, mask: impl Into<String>) -> Self
pub fn edit_mask(self, mask: impl Into<String>) -> Self
For text: the mask it is typed through, where 0 is a digit, A a letter and * anything.
Sourcepub fn predefined(
self,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn predefined( self, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
For text: the values offered to pick from.
Sourcepub fn secret(self) -> Self
pub fn secret(self) -> Self
Keeps it from everyone: a secured space never gives it out or takes it in, and no screen shows it, as with what is kept for a password.
Sourcepub fn criteria_of(self, entity: impl Into<String>) -> Self
pub fn criteria_of(self, entity: impl Into<String>) -> Self
For an expression: the entity whose fields it can be about, which gives it a filter builder.