Derive Macro concordium_std::Deletable

source ·
#[derive(Deletable)]
{
    // Attributes available to this derive:
    #[concordium]
}
Expand description

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

The trait should be derived for types which have not implemented the Serialize trait. That is, Deletable should be derived for types with a non-trivial state. Non-trivial state here means when you have a type MyState which has one or more fields comprised of StateBox, StateSet, or StateMap.

Please note that it is necessary to specify the generic parameter name for the HasStateApi generic parameter. To do so, use the #[concordium(state_parameter = "NameOfGenericParameter")] attribute on the type you are deriving Deletable for.

Example

#[derive(Serial, DeserialWithState, Deletable)]
#[concordium(state_parameter = "S")]
struct MyState<S> {
   my_state_map: StateMap<SomeType, SomeOtherType, S>,
}