pub trait Module: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn entity_types(&self) -> Vec<&str>;
fn links_config(&self) -> Result<LinksConfig>;
fn register_entities(&self, registry: &mut EntityRegistry);
fn get_entity_fetcher(
&self,
entity_type: &str,
) -> Option<Arc<dyn EntityFetcher>>;
// Provided method
fn version(&self) -> &str { ... }
}Expand description
Trait for a microservice module
Required Methods§
Sourcefn entity_types(&self) -> Vec<&str>
fn entity_types(&self) -> Vec<&str>
List of entity types managed by this module
Sourcefn links_config(&self) -> Result<LinksConfig>
fn links_config(&self) -> Result<LinksConfig>
Load links configuration
Sourcefn register_entities(&self, registry: &mut EntityRegistry)
fn register_entities(&self, registry: &mut EntityRegistry)
Register entities with the entity registry
This method should register all entity descriptors for the module. Each entity descriptor provides the CRUD routes for that entity.