macro_rules! delegate_transport_request_variant { ($request:ty, $response:ty, $($variant:ident),+) => { ... }; }
Expand description
Delegate the execution of a transport request to the appropriate variant of an enum wrapper.
Given two enums, request and response, that wrap multiple requests/responses for one object type, this macro implements TransportRequest for the request enum and delegates the execution of the transport request to the appropriate variant.
Each variant in request enum must have a corresponding variant in response enum. Variant names in request and response enums must match. Variants must take exactly one argument that implements TransportRequest (for request) and TransportResponse (for response), where for a given variant, response must be the response type of the request variant.
Macro delegate_enum! can be used to generate these enums and implement required traits.