class PotClient

Overview

Implementation of the C API bridge for the RPC client. More…

class PotClient {
public:
    // fields

    std::unique_ptr rpc_client;
    Potential::Client capability;
    kj::WaitScope* wait_scope;
    std::string last_error;

    // construction

    PotClient(std::unique_ptr client, Potential::Client cap);
};

Detailed Documentation

Implementation of the C API bridge for the RPC client.

This file implements the C-compatible wrapper for the Cap’n Proto RPC client. It manages the lifecycle of the EzRpcClient and handles error reporting through a simple string-based interface.

Container for the C++ objects required to manage an RPC session. It is exposed to C as an opaque pointer. The use of std::unique_ptr ensures that the RPC client is cleaned up correctly upon destruction.

Fields

std::unique_ptr rpc_client

The Cap’n Proto RPC client.

Potential::Client capability

The RPC capability for potential calls.

kj::WaitScope* wait_scope

Reference to the client wait scope.

std::string last_error

Buffer for the most recent error message.

Construction

PotClient(std::unique_ptr client, Potential::Client cap)

Constructor for PotClient.

Parameters:

client

Ownership of the initialized EzRpcClient.

cap

The capability client for the Potential interface.