mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 17:50:17 +00:00
rearrange configuration to be closer to where it's consumed
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user