TryFromEnvelope

Derive Macro TryFromEnvelope 

Source
#[derive(TryFromEnvelope)]
{
    // Attributes available to this derive:
    #[esrc]
}
Expand description

Derive a TryFromEnvelope implementation for an enum type.

This defines a method that uses the given Envelope’s name to determine which variant it should be deserialized as (each variant is expected to implement the Event trait). If no match found, return an Invalid error.

An esrc(ignore) attribute may be specified on individual variants to prevent them from being included in this set (it also allows non-Event variants to be included in the type).