pub struct AgentConfigManager {
pub global_path: PathBuf,
pub project_path: Option<PathBuf>,
pub global_config: Option<OhMyOpencodeConfig>,
pub project_config: Option<OhMyOpencodeConfig>,
}Expand description
Manages agent configuration files.
Fields§
§global_path: PathBufGlobal config file path.
project_path: Option<PathBuf>Project config file path.
global_config: Option<OhMyOpencodeConfig>Cached global config.
project_config: Option<OhMyOpencodeConfig>Cached project config.
Implementations§
Source§impl AgentConfigManager
impl AgentConfigManager
Sourcepub fn load_all(
&mut self,
) -> Result<(&Option<OhMyOpencodeConfig>, &Option<OhMyOpencodeConfig>)>
pub fn load_all( &mut self, ) -> Result<(&Option<OhMyOpencodeConfig>, &Option<OhMyOpencodeConfig>)>
Load all configs (global + project).
Sourcepub fn load_layer(
&self,
layer: ConfigLayer,
) -> Result<Option<OhMyOpencodeConfig>>
pub fn load_layer( &self, layer: ConfigLayer, ) -> Result<Option<OhMyOpencodeConfig>>
Load a single config layer.
Sourcepub fn save(
&self,
layer: ConfigLayer,
config: &OhMyOpencodeConfig,
) -> Result<()>
pub fn save( &self, layer: ConfigLayer, config: &OhMyOpencodeConfig, ) -> Result<()>
Save a config layer to disk.
Sourcepub fn path_for(&self, layer: ConfigLayer) -> &Path
pub fn path_for(&self, layer: ConfigLayer) -> &Path
Get the path for a specific layer.
Trait Implementations§
Source§impl Clone for AgentConfigManager
impl Clone for AgentConfigManager
Source§fn clone(&self) -> AgentConfigManager
fn clone(&self) -> AgentConfigManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentConfigManager
impl Debug for AgentConfigManager
Source§impl Default for AgentConfigManager
impl Default for AgentConfigManager
Source§impl PartialEq for AgentConfigManager
impl PartialEq for AgentConfigManager
Source§fn eq(&self, other: &AgentConfigManager) -> bool
fn eq(&self, other: &AgentConfigManager) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AgentConfigManager
Auto Trait Implementations§
impl Freeze for AgentConfigManager
impl RefUnwindSafe for AgentConfigManager
impl Send for AgentConfigManager
impl Sync for AgentConfigManager
impl Unpin for AgentConfigManager
impl UnsafeUnpin for AgentConfigManager
impl UnwindSafe for AgentConfigManager
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