Data

Trait Data 

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

Source

fn name(&self) -> &str

Get the name of this data entity

Source

fn indexed_fields() -> &'static [&'static str]

List of fields that should be indexed for searching

Source

fn field_value(&self, field: &str) -> Option<FieldValue>

Get the value of a specific field by name

Provided Methods§

Source

fn display(&self)

Display the entity for debugging

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.

Implementors§