Crate concordium_std_derive[][src]

Attribute Macros

Sets the cfg for testing targeting either Wasm and native.

Derive the appropriate export for an annotated test function, when feature “wasm-test” is enabled, otherwise behaves like #[test].

Marks a type as the contract state. Currently only used for generating the schema of the contract state. If the feature build-schema is not enabled this has no effect.

Derive the appropriate export for an annotated init function.

Derive the appropriate export for an annotated receive function.

Derive Macros

Derive the Deserial trait. See the documentation of derive(Serial) for details and limitations.

Derive the conversion of enums that represent error types into the Reject struct which can be used as the error type of init and receive functions. Creating custom enums for error types can provide meaningful error messages to the user of the smart contract.

Derive the SchemaType trait for a type. If the feature build-schema is not enabled this is a no-op, i.e., it does not produce any code.

Derive the Serial trait for the type.

A helper macro to derive both the Serial and Deserial traits. [derive(Serialize)] is equivalent to [derive(Serial,Deserial)], see documentation of the latter two for details and options.