pub trait Data: Entity {
// Required methods
fn name(&self) -> &str;
fn indexed_fields() -> &'static [&'static str];
fn field_value(&self, field: &str) -> Option<FieldValue>;
// Provided method
fn display(&self) { ... }
}Expand description
Trait for data entities that represent concrete domain objects.
Data entities extend the base Entity with:
- name: A human-readable name
- indexed_fields: Fields that can be searched
- field_value: Dynamic field access
Required Methods§
Sourcefn indexed_fields() -> &'static [&'static str]
fn indexed_fields() -> &'static [&'static str]
List of fields that should be indexed for searching
Sourcefn field_value(&self, field: &str) -> Option<FieldValue>
fn field_value(&self, field: &str) -> Option<FieldValue>
Get the value of a specific field by name
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.