Module candid::codegen::rust[][src]

Expand description

Language binding for generating Rust code from a Candid file.

This generates a pub trait Actor { ... } code for the service (if there is one) and a list of pub type TypeX = ... for each type declaration in a Candid file.

The Actor name can be configured, as well as whether to use u128/i128 for natural/integer numbers.

Structs

Traits

Allow extra bindings to be passed in for Rust generation. This is higher level bindings than languages ones.

Functions

Transforms a Candid ID into a valid Rust ID (as a string). In case a string cannot be used as an ID in Rust, this will replace it with a IDL Hash value of the ID, surrounged by _ (e.g. _12345_). If the string is a valid Rust

Takes an IDL string and returns a Rust string, unformatted.

Returns true if id is a rust keyword.