Customised modifier allowing user define how to modify input in provided callable.
More...
#include <Modifiers.hpp>
|
template<typename Fn >
requires std::invocable<Fn, boost::json::value&, std::string_view> |
| CustomModifier (Fn &&fn) |
| Constructs a custom modifier from any supported callable.
|
|
MaybeError | modify (boost::json::value &value, std::string_view key) const |
| Modify the JSON value according to the custom modifier function stored.
|
|
Customised modifier allowing user define how to modify input in provided callable.
◆ CustomModifier()
template<typename Fn >
requires std::invocable<Fn, boost::json::value&, std::string_view>
rpc::modifiers::CustomModifier::CustomModifier |
( |
Fn && | fn | ) |
|
|
inlineexplicit |
Constructs a custom modifier from any supported callable.
- Template Parameters
-
- Parameters
-
fn | The callable/function object |
◆ modify()
MaybeError rpc::modifiers::CustomModifier::modify |
( |
boost::json::value & | value, |
|
|
std::string_view | key ) const |
|
inlinenodiscard |
Modify the JSON value according to the custom modifier function stored.
- Parameters
-
value | The JSON value representing the outer object |
key | The key used to retrieve the tested value from the outer object |
- Returns
- Any compatible user-provided error if modify/verify failed; otherwise no error is returned
The documentation for this class was generated from the following file: