Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::modifiers::CustomModifier Class Referencefinal

Customised modifier allowing user define how to modify input in provided callable. More...

#include <Modifiers.hpp>

Public Member Functions

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.
 

Detailed Description

Customised modifier allowing user define how to modify input in provided callable.

Constructor & Destructor Documentation

◆ 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
FnThe type of callable
Parameters
fnThe callable/function object

Member Function Documentation

◆ 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
valueThe JSON value representing the outer object
keyThe 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: