FastLED 3.9.15
Loading...
Searching...
No Matches
fl::response_aware_signature< Sig > Struct Template Reference

Detailed Description

template<typename Sig>
struct fl::response_aware_signature< Sig >

Type trait to detect if a function signature has ResponseSend& as first parameter.

This trait is used to distinguish between:

  • Regular RPC methods: int(int, int)
  • Response-aware RPC methods: void(ResponseSend&, int, int)

For response-aware methods, the ResponseSend& parameter is stripped from the signature for JSON parameter matching:

  • Function signature: void(ResponseSend&, int, int)
  • JSON params: [int, int]

EXAMPLE:

// Regular method int add(int a, int b) { return a + b; } // Signature for JSON matching: int(int, int)

// Response-aware async method void addAsync(ResponseSend& send, int a, int b) { send.send(json::object().set("result", a + b)); } // Signature for JSON matching: void(int, int) <- ResponseSend& stripped

Definition at line 44 of file response_aware_traits.h.

#include <response_aware_traits.h>

+ Inheritance diagram for fl::response_aware_signature< Sig >:

Public Types

using signature = Sig
 

Static Public Attributes

static constexpr bool is_response_aware = false
 

The documentation for this struct was generated from the following file: