Skip to main content

seam_server/
page.rs

1/* packages/server/core/rust/src/page.rs */
2
3use std::collections::HashMap;
4use std::sync::Arc;
5
6pub type LoaderInputFn = Arc<dyn Fn(&HashMap<String, String>) -> serde_json::Value + Send + Sync>;
7
8pub struct LoaderDef {
9  pub data_key: String,
10  pub procedure: String,
11  pub input_fn: LoaderInputFn,
12}
13
14pub struct PageDef {
15  /// Axum route syntax, e.g. "/user/{id}"
16  pub route: String,
17  pub template: String,
18  pub loaders: Vec<LoaderDef>,
19}