canic-macros

Crates.iocanic-macros
lib.rscanic-macros
version0.7.26
created_at2025-12-06 17:35:23.076074+00
updated_at2026-01-10 15:09:04.28649+00
descriptionCanic — a canister orchestration and management toolkit for the Internet Computer
homepagehttps://github.com/dragginzgame/canic
repositoryhttps://github.com/dragginzgame/canic
max_upload_size
id1970455
size24,010
(borovan)

documentation

https://docs.rs/canic-macros

README

canic-macros

Proc macros for defining Internet Computer endpoints in Canic canisters.

This crate provides #[canic_query] and #[canic_update], which are thin wrappers around the IC CDK #[query] / #[update] attributes and route through Canic’s pipeline (guard → auth → env → rule → dispatch).

use canic::macros::{canic_query, canic_update};
use canic::prelude::*;

#[canic_query]
fn ping() -> String {
    "ok".to_string()
}

#[canic_update(guard(app), auth_any(is_controller), env(is_prime_subnet))]
async fn admin_only() -> Result<(), canic::Error> {
    Ok(())
}
Commit count: 1337

cargo fmt