Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 19 fields pub important_threshold: f64, pub urgent_within: i64, pub quadrant_limit: i64, pub tiers: [f64; 5], pub priorities: [f64; 4], pub signals: SignalPriorities, pub activity_ignore: Vec<String>, pub activity_horizon: [i64; 5], pub agent: String, pub preset: Option<String>, pub default_tier: Option<i64>, pub attribution: Attribution, pub max_parallel: i64, pub batch_budget: f64, pub agent_budget: f64, pub workflow_budget: f64, pub timeout: i64, pub notify: Option<String>, pub projects: BTreeMap<String, ProjectSettings>,
}

Fields§

§important_threshold: f64§urgent_within: i64

Days before due: at which a task becomes urgent.

§quadrant_limit: i64§tiers: [f64; 5]

Multiplier per tier, index 0 is tier 1.

§priorities: [f64; 4]

Weight per priority, in Priority::ALL order.

§signals: SignalPriorities

Priority of each signal task.

§activity_ignore: Vec<String>

Globs for paths whose commits do not count as activity.

§activity_horizon: [i64; 5]

Days without activity at which the activity signal reaches 1, per tier.

§agent: String

The worker pma dispatch runs, by name in the agents table.

§preset: Option<String>

The preset a dispatch takes when nothing names one; None falls back to agent and that worker’s own model.

§default_tier: Option<i64>

Tier for a project that has none, so untiered projects are ranked rather than invisible. None leaves them out, as before.

§attribution: Attribution§max_parallel: i64

Agents running at once.

§batch_budget: f64

USD a dispatch batch may spend.

§agent_budget: f64

USD one agent run may spend.

§workflow_budget: f64

The most a workflow revision’s worst case may cost, per unit of input, before pma workflow activate refuses it.

§timeout: i64

Minutes an agent run, or a verify run, may take.

§notify: Option<String>

A shell command run when a detached job ends, with PMA_JOB_ID, PMA_JOB_STATE and PMA_JOB_SUMMARY set.

§projects: BTreeMap<String, ProjectSettings>

Implementations§

Source§

impl Config

Source

pub fn tier_or_default(&self, tier: Option<u8>) -> Option<u8>

A project’s tier, else default_tier: what ranks it, and so what routes it.

Source

pub fn keys() -> Vec<String>

Source

pub fn with_overrides<'a>( rows: impl IntoIterator<Item = (&'a str, &'a str)>, ) -> Result<Config, String>

Applies stored overrides to the defaults.

Source

pub fn kind(key: &str) -> Option<&'static str>

The kind of value key takes, so settings.toml stores it typed.

Source

pub fn get(&self, key: &str) -> Option<String>

Source

pub fn set(&mut self, key: &str, value: &str) -> Result<(), String>

Sets one value; on error, nothing changes.

Source

pub fn tier(&self, tier: u8) -> f64

Source

pub fn priority(&self, p: Priority) -> f64

Source

pub fn project(&self, name: &str) -> ProjectSettings

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.