Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::FieldSpec Struct Referencefinal

Represents a Specification for one field of an RPC command. More...

#include <Specs.hpp>

Public Member Functions

template<SomeProcessor... Processors>
 FieldSpec (std::string const &key, Processors &&... processors)
 Construct a field specification out of a set of processors.
 
template<SomeCheck... Checks>
 FieldSpec (std::string const &key, Checks &&... checks)
 Construct a field specification out of a set of checkers.
 
MaybeError process (boost::json::value &value) const
 Processes the passed JSON value using the stored processors.
 
check::Warnings check (boost::json::value const &value) const
 Checks the passed JSON value using the stored checkers.
 

Detailed Description

Represents a Specification for one field of an RPC command.

Constructor & Destructor Documentation

◆ FieldSpec() [1/2]

template<SomeProcessor... Processors>
rpc::FieldSpec::FieldSpec ( std::string const & key,
Processors &&... processors )
inline

Construct a field specification out of a set of processors.

Template Parameters
ProcessorsThe types of processors
Parameters
keyThe key in a JSON object that the field validates
processorsThe processors, each of them have to fulfil the rpc::SomeProcessor concept

◆ FieldSpec() [2/2]

template<SomeCheck... Checks>
rpc::FieldSpec::FieldSpec ( std::string const & key,
Checks &&... checks )
inline

Construct a field specification out of a set of checkers.

Template Parameters
ChecksThe types of checkers
Parameters
keyThe key in a JSON object that the field validates
checksThe checks, each of them have to fulfil the rpc::SomeCheck concept

Member Function Documentation

◆ check()

check::Warnings rpc::FieldSpec::check ( boost::json::value const & value) const
nodiscard

Checks the passed JSON value using the stored checkers.

Parameters
valueThe JSON value to validate
Returns
A vector of warnings (empty if no warnings)

◆ process()

MaybeError rpc::FieldSpec::process ( boost::json::value & value) const
nodiscard

Processes the passed JSON value using the stored processors.

Parameters
valueThe JSON value to validate and/or modify
Returns
Nothing on success; Status on error

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