pub struct ConfigV1 {
pub version: u32,
pub gate: GateConfig,
pub checks: Vec<CheckConfig>,
}Fields§
§version: u32Schema version. Must equal CONFIG_VERSION; mismatches fail with
KlaspError::ConfigVersion.
gate: GateConfig§checks: Vec<CheckConfig>Implementations§
Source§impl ConfigV1
impl ConfigV1
Sourcepub fn load(repo_root: &Path) -> Result<Self>
pub fn load(repo_root: &Path) -> Result<Self>
Resolve and load klasp.toml. Lookup order per design §14:
$CLAUDE_PROJECT_DIR first (set by Claude Code), then the supplied
repo_root. The first existing file wins; any parse error
short-circuits.
The $CLAUDE_PROJECT_DIR candidate is only honoured when the process
cwd is inside that directory — otherwise a session bound to repo A
would run A’s gate against an unrelated sibling repo B. On mismatch
the env candidate is skipped and resolution falls through to
repo_root; if neither exists, KlaspError::ConfigNotFound is
returned and the gate fails open.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ConfigV1
impl<'de> Deserialize<'de> for ConfigV1
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 ConfigV1
impl RefUnwindSafe for ConfigV1
impl Send for ConfigV1
impl Sync for ConfigV1
impl Unpin for ConfigV1
impl UnsafeUnpin for ConfigV1
impl UnwindSafe for ConfigV1
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