Crate paladin_opkind_derive

source
Expand description

A derive macro for the RemoteExecute trait.

This construction enables operations to be serialized and executed by a remote service in an opaque manner. It uses the linkme crate to collect all operation execution pointers into a single slice that are gathered into a contiguous section of the binary by the linker.

§Implementation details

A globally unique identifier is assigned to each operation. Then, a unique function that handles deserialization, execution, and re-serialization of the result is generated for each operation. A pointer to this function is registered with the distributed slice at the index of the operation’s identifier. This allows execution function to be dereferenced by only the operation identifier, which is serialized with the task.

This scheme allows the tasks sent to workers to be opaque, while still enabling efficient lookup and execution of the appropriate operation.

Derive Macros§