mod profile_rs {
include!(concat!(env!("OUT_DIR"), "/consumer/profile_rs.rs"));
}
use profile_rs::{profile_rs, Profile};
#[update(name = "getSelf")]
async fn get_self() -> Profile {
profile_rs.get_self().await.unwrap().0
}
Note
This PR is just a intermediate state of the "Trait-Bound Canister Development" feature. The base branch of this PR is not main but a dedicated bindgen_next branch.
Support for provider and type will be implemented in the following PRs.
Docs and Changelog will be added when this overall feature is completed and before merge into the main branch.
SDK-1622
Description
The current API of
ic-cdk-bindgen
crate exposes many types from the dependencycandid_parser
.This rewrite is necessary for the upcoming "Trait-Bound Canister Development" feature. which will need Candid to Rust bindgen for various targets.
The targets will be supported:
Consumer
Provider
Type
Now, the main entry point to the
ic-cdk-bindgen
library isic_cdk_bindgen::Builder
.This PR focuses on changing the existing bindgen for inter-canister calls. In the context of Rust CDK, such usage is named
consumer
.Then in
lib.rs
of the consumer canister:Note
This PR is just a intermediate state of the "Trait-Bound Canister Development" feature. The base branch of this PR is not
main
but a dedicatedbindgen_next
branch.Support for provider and type will be implemented in the following PRs.
Docs and Changelog will be added when this overall feature is completed and before merge into the
main
branch.How Has This Been Tested?
examples: counter, profile
Checklist: