pub struct Settings {
pub priority: Vec<PriorityRule>,
pub agents: Vec<AgentConfig>,
/* private fields */
}Fields§
§priority: Vec<PriorityRule>§agents: Vec<AgentConfig>Implementations§
Source§impl Settings
impl Settings
Sourcepub fn priority_for_at(
&self,
agent: &AgentConfig,
model: Option<&str>,
now: &DateTime<Local>,
) -> i32
pub fn priority_for_at( &self, agent: &AgentConfig, model: Option<&str>, now: &DateTime<Local>, ) -> i32
Evaluates schedule conditions against now.
Among all matching rules, the one with the highest schedule specificity wins;
ties are broken by first occurrence (stable, original-order compatible).
Sourcepub fn priority_for_components_at(
&self,
command: &str,
provider: Option<&str>,
model: Option<&str>,
now: &DateTime<Local>,
) -> i32
pub fn priority_for_components_at( &self, command: &str, provider: Option<&str>, model: Option<&str>, now: &DateTime<Local>, ) -> i32
Among all matching rules, the one with the highest schedule specificity wins; ties are broken by first occurrence (stable, original-order compatible).
Sourcepub fn load(path: Option<&Path>) -> Result<Self, Box<dyn Error>>
pub fn load(path: Option<&Path>) -> Result<Self, Box<dyn Error>>
§Errors
Returns an error if the settings file cannot be read or parsed.
Sourcepub fn save(&self, path: Option<&Path>) -> Result<(), Box<dyn Error>>
pub fn save(&self, path: Option<&Path>) -> Result<(), Box<dyn Error>>
§Errors
Returns an error if serialization or file writing fails.
Sourcepub fn upsert_priority(
&mut self,
command: &str,
provider: Option<ProviderConfig>,
model: Option<String>,
priority: i32,
)
pub fn upsert_priority( &mut self, command: &str, provider: Option<ProviderConfig>, model: Option<String>, priority: i32, )
Upsert a PriorityRule. If a matching rule (command + provider + model) already exists,
its priority is updated. Otherwise a new rule is appended.
Sourcepub fn remove_priority(
&mut self,
command: &str,
provider: Option<&ProviderConfig>,
model: Option<&str>,
)
pub fn remove_priority( &mut self, command: &str, provider: Option<&ProviderConfig>, model: Option<&str>, )
Remove a PriorityRule matching the given (command, provider, model) triple.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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 Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
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