dfinity / examples

Example applications, microservices, and code samples for the Internet Computer
https://dfinity.org
Apache License 2.0
508 stars 324 forks source link

Example with guards and asynchronous code for Rust canisters #877

Closed gregorydemay closed 1 month ago

gregorydemay commented 1 month ago

Add an example for advanced Rust canister development showing the intricacies between:

  1. the IC asynchronous message model;
  2. its implementation with the Rust ic_cdk;

and their impact on guards, which are usually used to try to maintain some invariants. This is fairly specific to the Rust ic_cdk, since Motoko took another approach, where every async/await call will be converted to an inter-canister call (see asynchronous functions)