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: PathsFilesystem and network locations.
defaults: DefaultsFactory-wide defaults.
reserve: ReserveConfigThe factory-wide spend ceiling.
rates: RateCardPublished 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
impl Config
Sourcepub fn from_toml(
text: &str,
origin: impl Into<PathBuf>,
) -> Result<Self, ConfigError>
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.
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
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.
Sourcepub fn entry_agents(&self) -> impl Iterator<Item = &AgentName>
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.
Sourcepub fn fuel_for(&self, agent: &AgentName) -> f64
pub fn fuel_for(&self, agent: &AgentName) -> f64
Returns the effective Fuel budget for an itinerary started at agent.
Sourcepub fn declared_flags(&self) -> impl Iterator<Item = &str>
pub fn declared_flags(&self) -> impl Iterator<Item = &str>
Returns every flag name declared by any pipeline.
Sourcepub fn scheduled_pipelines(
&self,
) -> impl Iterator<Item = (&PipelineName, &Pipeline)>
pub fn scheduled_pipelines( &self, ) -> impl Iterator<Item = (&PipelineName, &Pipeline)>
Returns the pipelines a clock triggers.