canic-core 0.22.0

Canic — a canister orchestration and management toolkit for the Internet Computer
Documentation
use crate::{
    dto::{
        error::Error,
        pool::{CanisterPoolResponse, PoolAdminCommand, PoolAdminResponse},
    },
    workflow::pool::{PoolWorkflow, query::PoolQuery},
};

///
/// CanisterPoolApi
///

pub struct CanisterPoolApi;

impl CanisterPoolApi {
    #[must_use]
    pub fn list() -> CanisterPoolResponse {
        PoolQuery::pool_list()
    }

    pub async fn admin(cmd: PoolAdminCommand) -> Result<PoolAdminResponse, Error> {
        PoolWorkflow::handle_admin(cmd).await.map_err(Error::from)
    }
}