Skip to main content

Interface

Derive Macro Interface 

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

Derives the Interface trait for an enum, allowing it to be used as a message interface in the Polybox framework.

Under the hood, this macro generates implementations for the Interface, Message, and AsSet traits, as well as FromPayload and TryIntoPayload for each variant of the enum.

The macro expects the enum variants to be of the form Variant(Payload<T>), where T is a type that implements the Message trait.