pub struct Config {
pub skill: Option<SkillConfig>,
pub defaults: Defaults,
}Fields§
§skill: Option<SkillConfig>The persisted interview answers. When present, init skips the
interactive prompts entirely (design §5.1 step 2).
defaults: DefaultsPersistent user prefs, independent of any single skill. Filled in once and reused across re-runs.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(root: &Path) -> Result<Option<Config>>
pub fn load(root: &Path) -> Result<Option<Config>>
Read skillpack.toml from root. Returns None if the file does
not exist (the caller decides whether that means “fresh project, run
the interview” — it is not an error here).
Sourcepub fn save(&self, root: &Path) -> Result<PathBuf>
pub fn save(&self, root: &Path) -> Result<PathBuf>
Write the config back to disk, creating parent dirs as needed. Output is stable: field order matches the struct declaration so re-saves produce a minimal diff.
Sourcepub fn to_intent(&self) -> Option<Intent>
pub fn to_intent(&self) -> Option<Intent>
Build an Intent from this config, if a skill block is present.
Used by init to skip the interactive interview on re-runs.
Sourcepub fn from_intent(name: &str, intent: &Intent) -> Self
pub fn from_intent(name: &str, intent: &Intent) -> Self
Construct a config from an Intent + name, for the first-run save.
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