EntityFetcher

Trait EntityFetcher 

Source
pub trait EntityFetcher: Send + Sync {
    // Required method
    fn fetch_as_json<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entity_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for fetching entities dynamically

This allows the link system to enrich links with full entity data without knowing the concrete entity types at compile time.

Required Methods§

Source

fn fetch_as_json<'life0, 'life1, 'async_trait>( &'life0 self, entity_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch an entity by ID and return it as JSON

§Arguments
  • entity_id - The unique ID of the entity to fetch
§Returns

The entity serialized as JSON, or an error if not found

Implementors§