Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::meta::IfType< Type > Class Template Referencefinal

A meta-processor that specifies a list of requirements to run against when the type matches the template parameter. More...

#include <MetaProcessors.hpp>

Public Member Functions

template<SomeRequirement... Requirements>
 IfType (Requirements &&... requirements)
 Constructs a validator that validates the specs if the type matches.
 
 IfType (IfType const &)=default
 
 IfType (IfType &&)=default
 
MaybeError verify (boost::json::value &value, std::string_view key) const
 Verify that the element is valid according to the stored requirements when type matches.
 

Detailed Description

template<typename Type>
class rpc::meta::IfType< Type >

A meta-processor that specifies a list of requirements to run against when the type matches the template parameter.

Constructor & Destructor Documentation

◆ IfType()

template<typename Type >
template<SomeRequirement... Requirements>
rpc::meta::IfType< Type >::IfType ( Requirements &&... requirements)
inlineexplicit

Constructs a validator that validates the specs if the type matches.

Parameters
requirementsThe requirements to validate against

Member Function Documentation

◆ verify()

template<typename Type >
MaybeError rpc::meta::IfType< Type >::verify ( boost::json::value & value,
std::string_view key ) const
inlinenodiscard

Verify that the element is valid according to the stored requirements when type matches.

Parameters
valueThe JSON value representing the outer object
keyThe key used to retrieve the element from the outer object
Returns
Possibly an error

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