Skip to main content

pending_method

Macro pending_method 

Source
macro_rules! pending_method {
    ($name:ident, $method:literal, $reason:literal) => { ... };
}
Expand description

Generate an async stub handler that returns an Engine error with the given (method_name, reason) pair.

Why a macro: 29 daemon handlers across 7 modules all returned the same boilerplate (“X requires Y (pending)”). The macro keeps the message format consistent and the call site one line. Each pending handler is its own pub async fn so the dispatch table (which takes function pointers) sees them as first-class items.

When a handler moves from pending to real, delete the macro invocation and write the real pub async fn in its place.