canic 0.27.7

Canic — a canister orchestration and management toolkit for the Internet Computer
Documentation
#![cfg_attr(feature = "control-plane", allow(clippy::unused_async))]
// Example: minimal root canister scaffold.
// Compile this example with `cargo build -p canic --example minimal_root --features control-plane`.

#[cfg(feature = "control-plane")]
mod canister {
    use canic::prelude::*;

    // Set up a minimal root canister with default hooks.
    canic::start_root!();

    #[expect(clippy::unused_async)]
    async fn canic_setup() {}
    async fn canic_install() {}
    async fn canic_upgrade() {}

    // Minimal WASMS set required by the macro; empty in this example
    #[expect(dead_code)]
    pub static WASMS: &[(CanisterRole, &[u8])] = &[];

    #[canic_update]
    async fn ping() -> Result<String, canic::Error> {
        Ok("pong".to_string())
    }

    canic::cdk::export_candid_debug!();
}

#[cfg(feature = "control-plane")]
fn main() {
    println!("minimal_root example");
}

#[cfg(not(feature = "control-plane"))]
fn main() {
    println!("minimal_root example requires --features control-plane");
}