Crates.io | ic-cdk-bindgen |
lib.rs | ic-cdk-bindgen |
version | 0.1.3 |
source | src |
created_at | 2023-07-13 22:30:54.269353 |
updated_at | 2024-02-27 19:04:04.948338 |
description | Internet Computer Binding Generator. |
homepage | |
repository | https://github.com/dfinity/cdk-rs |
max_upload_size | |
id | 915694 |
size | 19,010 |
Generate Rust bindings from Candid to make inter-canister calls.
ic-cdk-bindgen
as a build dependency.[build-dependencies]
ic-cdk-bindgen = "0.1"
build.rs
to generate Rust bindings in the source directory with config options.use ic_cdk_bindgen::{Builder, Config};
fn main() {
let counter = Config::new("counter");
let mut builder = Builder::new();
builder.add(counter);
builder.build(None); // default write to src/declarations
}
mod declarations;
use declarations::counter::counter;
counter.inc().await?