pub struct FabrykConfig {
pub project_name: String,
pub base_path: Option<String>,
pub content: ContentConfig,
pub graph: GraphConfig,
pub server: ServerConfig,
}Expand description
Main configuration for Fabryk CLI applications.
Fields§
§project_name: StringProject name, used for env var prefixes and default paths.
base_path: Option<String>Base path for all project data.
content: ContentConfigContent-related configuration.
graph: GraphConfigGraph-related configuration.
server: ServerConfigServer configuration.
Implementations§
Source§impl FabrykConfig
impl FabrykConfig
Sourcepub fn load(config_path: Option<&str>) -> Result<Self>
pub fn load(config_path: Option<&str>) -> Result<Self>
Load configuration from file, environment, and defaults.
Loading priority:
- Explicit
config_path(from--configflag) FABRYK_CONFIGenv var- XDG default:
~/.config/fabryk/config.toml - Built-in defaults
Sourcepub fn resolve_config_path(explicit: Option<&str>) -> Option<PathBuf>
pub fn resolve_config_path(explicit: Option<&str>) -> Option<PathBuf>
Resolve the config file path from explicit flag, env var, or XDG default.
Sourcepub fn default_config_path() -> Option<PathBuf>
pub fn default_config_path() -> Option<PathBuf>
Return the XDG default config path.
Sourcepub fn to_toml_string(&self) -> Result<String>
pub fn to_toml_string(&self) -> Result<String>
Serialize this config to a pretty-printed TOML string.
Trait Implementations§
Source§impl Clone for FabrykConfig
impl Clone for FabrykConfig
Source§fn clone(&self) -> FabrykConfig
fn clone(&self) -> FabrykConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConfigManager for FabrykConfig
impl ConfigManager for FabrykConfig
Source§fn load(config_path: Option<&str>) -> Result<Self>
fn load(config_path: Option<&str>) -> Result<Self>
Load configuration from file/env, with an optional explicit file path.
Source§fn resolve_config_path(explicit: Option<&str>) -> Option<PathBuf>
fn resolve_config_path(explicit: Option<&str>) -> Option<PathBuf>
Resolve which config file path to use. Read more
Source§fn default_config_path() -> Option<PathBuf>
fn default_config_path() -> Option<PathBuf>
The default config file path (XDG config dir / project / config.toml).
Source§fn project_name() -> &'static str
fn project_name() -> &'static str
The project name, used in CLI output messages.
Source§fn to_toml_string(&self) -> Result<String>
fn to_toml_string(&self) -> Result<String>
Serialize this config to a TOML string.
Source§impl ConfigProvider for FabrykConfig
impl ConfigProvider for FabrykConfig
Source§impl Debug for FabrykConfig
impl Debug for FabrykConfig
Source§impl Default for FabrykConfig
impl Default for FabrykConfig
Source§impl<'de> Deserialize<'de> for FabrykConfigwhere
FabrykConfig: Default,
impl<'de> Deserialize<'de> for FabrykConfigwhere
FabrykConfig: Default,
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 FabrykConfig
impl RefUnwindSafe for FabrykConfig
impl Send for FabrykConfig
impl Sync for FabrykConfig
impl Unpin for FabrykConfig
impl UnsafeUnpin for FabrykConfig
impl UnwindSafe for FabrykConfig
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