pub struct ConfigStore {
pub config: ConfigToml,
/* private fields */
}Fields§
§config: ConfigTomlImplementations§
Source§impl ConfigStore
impl ConfigStore
pub fn load(path: Option<PathBuf>) -> Result<Self>
Sourcepub fn rendered_body(&self) -> Result<String>
pub fn rendered_body(&self) -> Result<String>
Render the exact body save would write: the serialized
config with comments and disabled keys from the originally-loaded file
merged back in. Exposed so setup flows can stage this body into a
persistence::SetupTransaction alongside sibling files and keep the
comment-preserving write atomic with the rest of the transaction.
pub fn save(&mut self) -> Result<()>
Sourcepub fn reload(&mut self) -> Result<()>
pub fn reload(&mut self) -> Result<()>
Refresh the typed value and byte snapshot after a targeted writer used the shared config lock. This keeps a long-lived command process from treating its own successful mutation as an external stale conflict.
pub fn path(&self) -> &Path
pub fn permissions(&self) -> &PermissionsToml
pub fn permissions_path(&self) -> PathBuf
pub fn exec_policy_engine(&self) -> ExecPolicyEngine
Sourcepub fn append_ask_rules(&mut self, rules: &[ToolAskRule]) -> Result<usize>
pub fn append_ask_rules(&mut self, rules: &[ToolAskRule]) -> Result<usize>
Atomically append ask-only permission rules to the sibling
permissions.toml file.
Existing comments and formatting are preserved. Exact duplicate rules are ignored, and the in-memory permissions snapshot is refreshed after a successful write.
Sourcepub fn append_allow_rules(&mut self, rules: &[ToolAskRule]) -> Result<usize>
pub fn append_allow_rules(&mut self, rules: &[ToolAskRule]) -> Result<usize>
Atomically append exact, repo-scoped allow rules to the sibling
permissions.toml file.
The caller is responsible for deciding which tool calls are eligible; this boundary rejects broad or incorrectly typed records so a UI bug cannot persist an unscoped allow grant.
Trait Implementations§
Source§impl Clone for ConfigStore
impl Clone for ConfigStore
Source§fn clone(&self) -> ConfigStore
fn clone(&self) -> ConfigStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more