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