| Crates.io | canic-macros |
| lib.rs | canic-macros |
| version | 0.7.26 |
| created_at | 2025-12-06 17:35:23.076074+00 |
| updated_at | 2026-01-10 15:09:04.28649+00 |
| description | Canic — a canister orchestration and management toolkit for the Internet Computer |
| homepage | https://github.com/dragginzgame/canic |
| repository | https://github.com/dragginzgame/canic |
| max_upload_size | |
| id | 1970455 |
| size | 24,010 |
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(())
}