[−][src]Module candid::codegen::rust
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
Config |
Traits
RustBindings | Allow extra bindings to be passed in for Rust generation. This is higher level bindings than languages ones. |
Functions
candid_id_to_rust | 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 |
idl_to_rust | Takes an IDL string and returns a Rust string, unformatted. |
is_keyword | Returns true if id is a rust keyword. |