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

Represents a Specification of an entire RPC command. More...

#include <Specs.hpp>

Public Member Functions

 RpcSpec (std::initializer_list< FieldSpec > fields)
 Construct a full RPC request specification.
 
 RpcSpec (RpcSpec const &other, std::initializer_list< FieldSpec > additionalFields)
 Construct a full RPC request specification from another spec and additional fields.
 
MaybeError process (boost::json::value &value) const
 Processes the passed JSON value using the stored field specs.
 
boost::json::array check (boost::json::value const &value) const
 Checks the passed JSON value using the stored field specs.
 

Detailed Description

Represents a Specification of an entire RPC command.

Note: this should really be all constexpr and handlers would expose static constexpr RpcSpec spec instead. Maybe some day in the future.

Constructor & Destructor Documentation

◆ RpcSpec() [1/2]

rpc::RpcSpec::RpcSpec ( std::initializer_list< FieldSpec > fields)
inline

Construct a full RPC request specification.

Parameters
fieldsThe fields of the RPC specification FieldSpec

◆ RpcSpec() [2/2]

rpc::RpcSpec::RpcSpec ( RpcSpec const & other,
std::initializer_list< FieldSpec > additionalFields )
inline

Construct a full RPC request specification from another spec and additional fields.

Parameters
otherThe other spec to copy fields from
additionalFieldsThe additional fields to add to the spec

Member Function Documentation

◆ check()

boost::json::array rpc::RpcSpec::check ( boost::json::value const & value) const
nodiscard

Checks the passed JSON value using the stored field specs.

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

◆ process()

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

Processes the passed JSON value using the stored field specs.

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: