pub struct Config {
pub project: ProjectConfig,
pub sync: SyncConfig,
pub environments: BTreeMap<String, EnvironmentConfig>,
}Expand description
Main configuration file (rigg.yaml)
Fields§
§project: ProjectConfig§sync: SyncConfig§environments: BTreeMap<String, EnvironmentConfig>Implementations§
Source§impl Config
impl Config
Sourcepub fn files_root(&self, project_root: &Path) -> PathBuf
pub fn files_root(&self, project_root: &Path) -> PathBuf
Root directory for resource files (search/, foundry/).
When project.files_path is set, returns project_root/files_path.
Otherwise returns project_root itself.
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 resolve_env(
&self,
name: Option<&str>,
) -> Result<ResolvedEnvironment, ConfigError>
pub fn resolve_env( &self, name: Option<&str>, ) -> Result<ResolvedEnvironment, ConfigError>
Resolve an environment by name (or default)
Sourcepub fn default_env_name(&self) -> Option<&str>
pub fn default_env_name(&self) -> Option<&str>
Find the default environment name
Sourcepub fn environment_names(&self) -> Vec<&str>
pub fn environment_names(&self) -> Vec<&str>
Get all environment names
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 UnsafeUnpin 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