pub struct Config {
pub service: ServiceConfig,
pub project: ProjectConfig,
pub sync: SyncConfig,
}Expand description
Main configuration file (hoist.toml)
Fields§
§service: ServiceConfigAzure Search service configuration
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 service_url(&self) -> String
pub fn service_url(&self) -> String
Get the base URL for the Azure Search service
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 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
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more