canic_core/api/pool.rs
1use crate::{
2 dto::{
3 error::Error,
4 pool::{CanisterPoolView, PoolAdminCommand, PoolAdminResponse},
5 },
6 workflow::pool::{PoolWorkflow, query::PoolQuery},
7};
8
9///
10/// CanisterPoolApi
11///
12
13pub struct CanisterPoolApi;
14
15impl CanisterPoolApi {
16 #[must_use]
17 pub fn list_view() -> CanisterPoolView {
18 PoolQuery::pool_list_view()
19 }
20
21 pub async fn admin(cmd: PoolAdminCommand) -> Result<PoolAdminResponse, Error> {
22 PoolWorkflow::handle_admin(cmd).await.map_err(Error::from)
23 }
24}