pub struct Config {
pub service: Option<ServiceConfig>,
pub services: ServicesConfig,
pub project: ProjectConfig,
pub sync: SyncConfig,
}Expand description
Main configuration file (hoist.toml)
Fields§
§service: Option<ServiceConfig>Legacy Azure Search service configuration (auto-migrated to services.search)
services: ServicesConfigMulti-service configuration (v0.2.0+)
project: ProjectConfigProject settings
sync: SyncConfigPull/push settings
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(dir: &Path) -> Result<Self, ConfigError>
pub fn load(dir: &Path) -> Result<Self, ConfigError>
Load configuration from a directory
Sourcepub fn load_from(path: &Path) -> Result<Self, ConfigError>
pub fn load_from(path: &Path) -> Result<Self, ConfigError>
Load configuration from a specific file path
Sourcepub fn save_to(&self, path: &Path) -> Result<(), ConfigError>
pub fn save_to(&self, path: &Path) -> Result<(), ConfigError>
Save configuration to a specific file path
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate configuration
Sourcepub fn search_services(&self) -> Vec<SearchServiceConfig>
pub fn search_services(&self) -> Vec<SearchServiceConfig>
Get all search service configs (including legacy auto-migrated)
Sourcepub fn foundry_services(&self) -> &[FoundryServiceConfig]
pub fn foundry_services(&self) -> &[FoundryServiceConfig]
Get all foundry service configs
Sourcepub fn has_foundry(&self) -> bool
pub fn has_foundry(&self) -> bool
Quick check if any foundry services are configured
Sourcepub fn primary_search_service(&self) -> Option<SearchServiceConfig>
pub fn primary_search_service(&self) -> Option<SearchServiceConfig>
Get the primary search service config (first one, for backward compat)
Sourcepub fn service_url(&self) -> String
pub fn service_url(&self) -> String
Get the base URL for the Azure Search service (backward compat helper)
Sourcepub fn resource_dir(&self, project_root: &Path) -> PathBuf
pub fn resource_dir(&self, project_root: &Path) -> PathBuf
Get the base directory for resource files (project_root or project_root/path)
Sourcepub fn search_service_dir(
&self,
project_root: &Path,
service_name: &str,
) -> PathBuf
pub fn search_service_dir( &self, project_root: &Path, service_name: &str, ) -> PathBuf
Base directory for a specific search service’s resources Returns: resource_dir / “search-resources” / service_name
Sourcepub fn foundry_service_dir(
&self,
project_root: &Path,
service_name: &str,
project: &str,
) -> PathBuf
pub fn foundry_service_dir( &self, project_root: &Path, service_name: &str, project: &str, ) -> PathBuf
Base directory for a specific foundry service/project’s resources Returns: resource_dir / “foundry-resources” / service_name / project_name
Sourcepub fn api_version_for(&self, preview: bool) -> &str
pub fn api_version_for(&self, preview: bool) -> &str
Get the API version to use for a resource (backward compat helper)