Skip to main content

canic_core/api/
state.rs

1use crate::{
2    dto::{
3        error::Error,
4        state::{AppCommand, AppCommandResponse},
5    },
6    workflow::state::AppStateWorkflow,
7};
8
9/// Re-export of read-only state query surfaces.
10pub use crate::workflow::state::query::{AppStateQuery, SubnetStateQuery};
11
12///
13/// AppStateApi
14///
15
16pub struct AppStateApi;
17
18impl AppStateApi {
19    pub async fn execute_command(cmd: AppCommand) -> Result<AppCommandResponse, Error> {
20        AppStateWorkflow::execute_command(cmd)
21            .await
22            .map_err(Error::from)
23    }
24}