rearrange configuration to be closer to where it's consumed

This commit is contained in:
2025-10-11 14:11:31 -07:00
parent 77126e40ae
commit 449eb85ab8
10 changed files with 92 additions and 93 deletions

View File

@@ -1,4 +1,5 @@
use crate::context::Context;
use serde::{Deserialize, Serialize};
use std::rc::Rc;
pub mod chainload;
@@ -7,6 +8,17 @@ pub mod print;
#[cfg(feature = "splash")]
pub mod splash;
#[derive(Serialize, Deserialize, Default, Clone)]
pub struct ActionDeclaration {
#[serde(default)]
pub chainload: Option<chainload::ChainloadConfiguration>,
#[serde(default)]
pub print: Option<print::PrintConfiguration>,
#[serde(default)]
#[cfg(feature = "splash")]
pub splash: Option<splash::SplashConfiguration>,
}
pub fn execute(context: Rc<Context>, name: impl AsRef<str>) {
let Some(action) = context.root().actions().get(name.as_ref()) else {
panic!("unknown action: {}", name.as_ref());