xrpld
Loading...
Searching...
No Matches
xrpl::rpc::VersionHandler Class Reference

Handles the version RPC method. More...

#include <Version.h>

Collaboration diagram for xrpl::rpc::VersionHandler:

Classes

struct  Output
 The data a version request produces, written out by writeResult(). More...

Public Member Functions

 VersionHandler (JsonContext &context)
 Construct a handler for a single request.
std::expected< Output, ::rpc::Status > process () const
 Process the request.

Static Public Member Functions

static void writeResult (json::Value &obj, Output const &output)
 Write the output of process() into the response.

Private Attributes

std::reference_wrapper< JsonContext > context_

Detailed Description

Handles the version RPC method.

Definition at line 20 of file Version.h.

Constructor & Destructor Documentation

◆ VersionHandler()

xrpl::rpc::VersionHandler::VersionHandler ( JsonContext & context)
explicit

Construct a handler for a single request.

Parameters
contextThe context of the request being handled.

Definition at line 37 of file Version.h.

Member Function Documentation

◆ process()

std::expected< Output, ::rpc::Status > xrpl::rpc::VersionHandler::process ( ) const
nodiscard

Process the request.

Returns
The output to write, or the status of the error.

Definition at line 47 of file Version.h.

◆ writeResult()

void xrpl::rpc::VersionHandler::writeResult ( json::Value & obj,
Output const & output )
static

Write the output of process() into the response.

Parameters
objThe response to write into.
outputThe output process() returned.

Definition at line 62 of file Version.h.

Member Data Documentation

◆ context_

std::reference_wrapper<JsonContext> xrpl::rpc::VersionHandler::context_
private

Definition at line 68 of file Version.h.