Crate mpc_macros

Crate mpc_macros 

Source
Expand description

§MPC Macros

This crate provides procedural macros for the async-mpc library:

  1. define_task! - Generates async task implementations with dependency management
  2. TaskGetters - Derives getter functions for task enum variants

§define_task! Macro

The define_task! macro automates the creation of task wrappers, async execution logic, and dependency management for MPC computations.

§TaskGetters Derive Macro

The TaskGetters derive macro automatically generates try_get_*_task functions for each variant in a TaskType enum, eliminating repetitive boilerplate code.

For detailed documentation and examples, see the individual implementation modules.

Macros§

define_task
Generates async-mpc task implementations with automatic dependency management.
dump_protocol_tags
Macro to dump the current state of the protocol tag registry at compile time (for debugging)
new_protocol
Macro to ensure protocol tag uniqueness at compile time. This macro generates a unique tag for a given protocol name, and checks against a registry to prevent collisions. If a collision is detected, it finds the next available tag.

Derive Macros§

GateMethods
Derives Gate::map_labels and Gate::for_each_label
TaskGetters
Derives try_get_*_task functions for enum variants containing task types.