Crate unc_sdk_macros
source ·Attribute Macros§
- callbackDeprecated
callbackis a marker attribute it does not generate code by itself. - callback_vecDeprecated
callback_args_vecis a marker attribute it does not generate code by itself. ext_contracttakes a Rust Trait and converts it to a module with static methods. Each of these static methods takes positional arguments defined by the Trait, then the receiver_id, the attached deposit and the amount of gas and returns a new Promise.- initDeprecated
initis a marker attribute it does not generate code by itself. - result_serializerDeprecated
result_serializeris a marker attribute it does not generate code by itself. - serializerDeprecated
serializeris a marker attribute it does not generate code by itself. - This attribute macro is used on a struct and its implementations to generate the necessary code to expose
pubmethods from the contract as well as generating the glue code to be a valid UNC contract.
Derive Macros§
BorshStorageKeygenerates implementation forBorshIntoStorageKeytrait. It allows the type to be passed as a unique prefix for persistent collections. The type should also implement or deriveBorshSerializetrait.- NOTE: This is an internal implementation for
#[unc_bindgen(events(standard = ...))]attribute. FunctionErrorgenerates implementation forunc_sdk::FunctionErrortrait. It allows contract runtime to panic with the type using itsToStringimplementation as the message.PanicOnDefaultgenerates implementation forDefaulttrait that panics with the following messageThe contract is not initializedwhendefault()is called. This is a helpful macro in case the contract is required to be initialized with eitherinitorinit(ignore_state).