macro_rules! declare_raft_types {
    ( $(#[$outer:meta])* $visibility:vis $id:ident: $($(#[$inner:meta])* $type_id:ident = $type:ty),+ ) => { ... };
}
Expand description

Define types for a Raft type configuration.

Since Rust has some limitations when deriving traits for types with generic arguments and most types are parameterized by RaftTypeConfig, we need to add supertraits to a type implementing RaftTypeConfig.

This macro does exactly that.

Example:

openraft::declare_raft_types!(
   /// Declare the type configuration for `MemStore`.
   pub Config: D = ClientRequest, R = ClientResponse, NodeId = MemNodeId
);