Load all catalogs from storage Iterates through all registered catalogs and loads their state from storage using the catalog's load method. # Returns `Ok(())` if all catalogs loaded successfully `Err(CatalogError)` if any catalog failed to load
(&mut self)
| 193 | /// * `Ok(())` if all catalogs loaded successfully |
| 194 | /// * `Err(CatalogError)` if any catalog failed to load |
| 195 | pub fn load_all(&mut self) -> CatalogResult<()> { |
| 196 | for (name, catalog) in &mut self.catalogs { |
| 197 | log::debug!("Loading catalog '{}'", name); |
| 198 | |
| 199 | // Load catalog provider data from storage if it exists |
| 200 | if let Some(data) = self.storage.load_catalog_provider(name).map_err(|e| { |
| 201 | CatalogError::OperationFailed(format!("Failed to load catalog '{}': {}", name, e)) |
| 202 | })? { |
| 203 | catalog.load(&data).map_err(|e| { |
| 204 | CatalogError::OperationFailed(format!( |
| 205 | "Failed to deserialize catalog '{}': {}", |
| 206 | name, e |
| 207 | )) |
| 208 | })?; |
| 209 | |
| 210 | log::debug!("Loaded catalog '{}': {} bytes", name, data.len()); |
| 211 | } else { |
| 212 | log::debug!( |
| 213 | "No stored data found for catalog '{}', using empty state", |
| 214 | name |
| 215 | ); |
| 216 | } |
| 217 | } |
| 218 | Ok(()) |
| 219 | } |
| 220 | |
| 221 | /// Get reference to the storage manager |
| 222 | /// |
nothing calls this directly
no test coverage detected