Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub layover: Paths,
    pub defaults: Defaults,
    pub reserve: ReserveConfig,
    pub rates: RateCard,
    pub runners: BTreeMap<String, Runner>,
    pub agents: BTreeMap<AgentName, Agent>,
    pub pipelines: BTreeMap<PipelineName, Pipeline>,
    pub routes: Vec<Route>,
}
Expand description

A whole factory definition.

Fields§

§layover: Paths

Filesystem and network locations.

§defaults: Defaults

Factory-wide defaults.

§reserve: ReserveConfig

The factory-wide spend ceiling.

§rates: RateCard

Published model prices, used only when a runner reports tokens but no cost.

§runners: BTreeMap<String, Runner>

Available runners, keyed by name.

§agents: BTreeMap<AgentName, Agent>

Configured agents, keyed by name.

§pipelines: BTreeMap<PipelineName, Pipeline>

Named, triggerable entry points, keyed by name.

§routes: Vec<Route>

The route map.

Implementations§

Source§

impl Config

Source

pub fn from_toml( text: &str, origin: impl Into<PathBuf>, ) -> Result<Self, ConfigError>

Parses a factory definition from TOML text.

§Errors

Returns ConfigError::Parse if the text is not a valid factory definition, including when it carries fields Layover does not recognise.

Source

pub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>

Reads and parses a factory definition from disk.

§Errors

Returns ConfigError::Read if the file cannot be read, or ConfigError::Parse if its contents are not a valid factory definition.

Source

pub fn entry_agents(&self) -> impl Iterator<Item = &AgentName>

Returns the agents a human or a schedule may send flights to.

An agent is an entry point when it is marked entry = true or when a pipeline names it. The two are different things: entry is a bare permission, while a pipeline is a named trigger that also carries a schedule and flags.

Each agent appears once however many pipelines name it.

Source

pub fn fuel_for(&self, agent: &AgentName) -> f64

Returns the effective Fuel budget for an itinerary started at agent.

Source

pub fn declared_flags(&self) -> impl Iterator<Item = &str>

Returns every flag name declared by any pipeline.

Source

pub fn scheduled_pipelines( &self, ) -> impl Iterator<Item = (&PipelineName, &Pipeline)>

Returns the pipelines a clock triggers.

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<'de> Deserialize<'de> for Config

Source§

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§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V