| Crates.io | canic-dsl-macros |
| lib.rs | canic-dsl-macros |
| version | 0.9.10 |
| created_at | 2026-01-13 17:31:54.030747+00 |
| updated_at | 2026-01-23 13:33:06.933566+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 | 2040764 |
| size | 42,723 |
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 (requires -> dispatch).
Use all(...), any(...), and not(...) inside requires(...) for composition.
use canic_dsl_macros::{canic_query, canic_update};
#[canic_query]
fn ping() -> String {
"ok".to_string()
}
#[canic_update(requires(app::allows_updates(), caller::is_controller()))]
async fn admin_only_expr() -> Result<(), canic::Error> {
Ok(())
}
#[canic_update(internal, requires(caller::is_parent()))]
async fn sync_state() -> Result<(), canic::Error> {
Ok(())
}