pub struct ModelLoader<B: StorageBackend> { /* private fields */ }Expand description
Model loader that uses a storage backend
Implementations§
Source§impl<B: StorageBackend> ModelLoader<B>
impl<B: StorageBackend> ModelLoader<B>
Sourcepub async fn load_model(
&self,
workspace_path: &str,
) -> Result<ModelLoadResult, StorageError>
pub async fn load_model( &self, workspace_path: &str, ) -> Result<ModelLoadResult, StorageError>
Load a model from storage
For file-based backends (FileSystemStorageBackend, BrowserStorageBackend):
- Loads from flat files in workspace root using naming convention
- Loads from
relationships.yamlfile
For API backend (ApiStorageBackend), use load_model_from_api() instead.
Returns the loaded model data and a list of orphaned relationships (relationships that reference non-existent tables).
Sourcepub async fn load_domains(
&self,
workspace_path: &str,
) -> Result<DomainLoadResult, StorageError>
pub async fn load_domains( &self, workspace_path: &str, ) -> Result<DomainLoadResult, StorageError>
Load all domains from storage
Loads domains and assets from flat files in the workspace root directory. Uses the file naming convention: {workspace}{domain}{system}_{resource}.xxx.yaml
Domain and system information is extracted from filenames and the workspace.yaml file.
Sourcepub async fn load_domains_from_list(
&self,
workspace_path: &str,
_domain_directory_names: &[String],
) -> Result<DomainLoadResult, StorageError>
👎Deprecated since 2.0.0: Use load_domains() with flat file structure instead. Domain directories are no longer supported.
pub async fn load_domains_from_list( &self, workspace_path: &str, _domain_directory_names: &[String], ) -> Result<DomainLoadResult, StorageError>
Load domains from explicit domain directory names (DEPRECATED)
This method is deprecated. Use load_domains() with flat file structure instead.
Sourcepub async fn load_decisions(
&self,
workspace_path: &str,
) -> Result<DecisionLoadResult, StorageError>
pub async fn load_decisions( &self, workspace_path: &str, ) -> Result<DecisionLoadResult, StorageError>
Load all decisions from workspace using flat file structure
Loads all .madr.yaml files from the workspace directory and parses them
into Decision structs using DecisionImporter.
§Arguments
workspace_path- Path to the workspace directory
§Returns
A DecisionLoadResult containing loaded decisions and any errors encountered
Sourcepub async fn load_decision_index(
&self,
workspace_path: &str,
) -> Result<Option<DecisionIndex>, StorageError>
pub async fn load_decision_index( &self, workspace_path: &str, ) -> Result<Option<DecisionIndex>, StorageError>
Sourcepub async fn load_knowledge(
&self,
workspace_path: &str,
) -> Result<KnowledgeLoadResult, StorageError>
pub async fn load_knowledge( &self, workspace_path: &str, ) -> Result<KnowledgeLoadResult, StorageError>
Load all knowledge articles from workspace using flat file structure
Loads all .kb.yaml files from the workspace directory and parses them
into KnowledgeArticle structs using KnowledgeImporter.
§Arguments
workspace_path- Path to the workspace directory
§Returns
A KnowledgeLoadResult containing loaded articles and any errors encountered
Sourcepub async fn load_knowledge_index(
&self,
workspace_path: &str,
) -> Result<Option<KnowledgeIndex>, StorageError>
pub async fn load_knowledge_index( &self, workspace_path: &str, ) -> Result<Option<KnowledgeIndex>, StorageError>
Sourcepub async fn load_knowledge_by_domain(
&self,
workspace_path: &str,
domain: &str,
) -> Result<KnowledgeLoadResult, StorageError>
pub async fn load_knowledge_by_domain( &self, workspace_path: &str, domain: &str, ) -> Result<KnowledgeLoadResult, StorageError>
Sourcepub async fn load_decisions_by_domain(
&self,
workspace_path: &str,
domain: &str,
) -> Result<DecisionLoadResult, StorageError>
pub async fn load_decisions_by_domain( &self, workspace_path: &str, domain: &str, ) -> Result<DecisionLoadResult, StorageError>
Sourcepub async fn load_workspace(
&self,
workspace_path: &str,
) -> Result<Option<Workspace>, StorageError>
pub async fn load_workspace( &self, workspace_path: &str, ) -> Result<Option<Workspace>, StorageError>
Sourcepub async fn save_workspace(
&self,
workspace_path: &str,
workspace: &Workspace,
) -> Result<(), StorageError>
pub async fn save_workspace( &self, workspace_path: &str, workspace: &Workspace, ) -> Result<(), StorageError>
Save workspace configuration to workspace.yaml
§Arguments
workspace_path- Path to the workspace directoryworkspace- The Workspace configuration to save
Sourcepub async fn load_domain_config(
&self,
domain_dir: &str,
) -> Result<Option<DomainConfig>, StorageError>
pub async fn load_domain_config( &self, domain_dir: &str, ) -> Result<Option<DomainConfig>, StorageError>
Sourcepub async fn save_domain_config(
&self,
domain_dir: &str,
config: &DomainConfig,
) -> Result<(), StorageError>
pub async fn save_domain_config( &self, domain_dir: &str, config: &DomainConfig, ) -> Result<(), StorageError>
Save domain configuration to domain.yaml
§Arguments
domain_dir- Path to the domain directoryconfig- The DomainConfig to save
Sourcepub async fn load_domain_config_by_name(
&self,
workspace_path: &str,
domain_name: &str,
) -> Result<Option<DomainConfig>, StorageError>
pub async fn load_domain_config_by_name( &self, workspace_path: &str, domain_name: &str, ) -> Result<Option<DomainConfig>, StorageError>
Sourcepub async fn get_domain_id(
&self,
domain_dir: &str,
) -> Result<Option<Uuid>, StorageError>
👎Deprecated since 2.0.0: Domain directories are no longer supported. Domain info is in workspace.yaml
pub async fn get_domain_id( &self, domain_dir: &str, ) -> Result<Option<Uuid>, StorageError>
Get domain ID from domain.yaml, or None if not found
Get domain ID from domain.yaml (DEPRECATED)
This method is deprecated. Domain information is now stored in workspace.yaml.
Sourcepub async fn load_all_domain_configs(
&self,
workspace_path: &str,
) -> Result<Vec<DomainConfig>, StorageError>
👎Deprecated since 2.0.0: Domain directories are no longer supported. Use load_workspace() instead
pub async fn load_all_domain_configs( &self, workspace_path: &str, ) -> Result<Vec<DomainConfig>, StorageError>
Load all domain configurations from a workspace (DEPRECATED)
This method is deprecated. Use load_workspace() and access domains from the workspace.