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
tables/subdirectory with YAML files - 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
Scans the workspace for domain directories and loads each domain along with its associated ODCS tables, ODPS products, and CADS assets.
Domain directories are identified by the presence of a domain.yaml file.
Sourcepub async fn load_domains_from_list(
&self,
workspace_path: &str,
domain_directory_names: &[String],
) -> Result<DomainLoadResult, StorageError>
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
This is more reliable than load_domains() when you know the domain directory names,
as it doesn’t rely on directory discovery which may be limited by the storage backend.
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