pub trait Data: Entity {
// Required methods
fn id(&self) -> Uuid;
fn tenant_id(&self) -> Uuid;
fn indexed_fields() -> &'static [&'static str];
fn field_value(&self, field: &str) -> Option<FieldValue>;
// Provided method
fn type_name() -> &'static str { ... }
}Expand description
Trait for data entities that represent concrete domain objects.
Data entities are the primary building blocks of the system. They have:
- A unique identifier
- Tenant isolation
- Searchable fields
- Type information
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
Returns None if the field doesn’t exist or can’t be converted
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.