rpc.core

Core functionnalities of the RPC framework.

Public Imports

unit_threaded
public import unit_threaded;

Members

Aliases

RpcErrorHandler
alias RpcErrorHandler = void delegate(Exception e) @(safe) nothrow
RpcRequestHandler
alias RpcRequestHandler(TRequest, TResponse) = void delegate(TRequest req, IRpcServerOutput!TResponse serv) @(safe)

A RPC request handler

rpcIdType
alias rpcIdType(T) = RpcIdTypeAttribute!T
Undocumented in source.

Classes

HttpRpcClient
class HttpRpcClient(TId, TRequest, TResponse)

Base implementation of an Http RPC client.

HttpRpcServer
class HttpRpcServer(TId, TRequest, TResponse)

An HTTP RPC server.

IdGenerator
class IdGenerator(TId : int)

An int id generator.

IdGenerator
class IdGenerator(TId : string)

A string id generator.

RawRpcClient
class RawRpcClient(TId, TRequest, TResponse)

A raw rpc client sending TRequest and receiving TResponse object through Input/Output stream.

RawRpcServer
class RawRpcServer(TId, TRequest, TResponse)
Undocumented in source.
RpcException
class RpcException

Base class for RPC exceptions.

RpcInterfaceSettings
class RpcInterfaceSettings

Hold settings to be used by the rpc interface.

RpcNotConnectedException
class RpcNotConnectedException

Client not connected exception

RpcParsingException
class RpcParsingException

Parsing exception.

RpcTimeoutException
class RpcTimeoutException

RPC call timeout on client-side.

UnhandledRpcMethod
class UnhandledRpcMethod

Unhandled RPC method on server-side.

Enums

ShouldFail
enum ShouldFail
Undocumented in source.
hasRpcArrayParams
eponymoustemplate hasRpcArrayParams(alias M)

attributes utils

Functions

rpcMethod
RpcMethodAttribute rpcMethod(string method)

Methods marked with this attribute will be treated as rpc endpoints.

rpcObjectParams
RpcMethodObjectParams rpcObjectParams()
RpcMethodObjectParams rpcObjectParams(string[string] names)

Methods marked with this attribute will see its parameters rendered as an object (if applicable by the protocol).

Interfaces

IIdGenerator
interface IIdGenerator(TId)

Define an id generator.

IRpcClient
interface IRpcClient(TId, TRequest, TResponse)

An RPC client working with TRequest and TResponse.

IRpcRequest
interface IRpcRequest(TId)

An RPC request identified by an id of type TId.

IRpcResponse
interface IRpcResponse

An RPC response.

IRpcServer
interface IRpcServer(TId, TRequest, TResponse)

An RPC server that can register handler.

IRpcServerOutput
interface IRpcServerOutput(TResponse : IRpcResponse)

Represent server to client stream.

Properties

noRpcMethod
NoRpcMethodAttribute noRpcMethod [@property getter]

Methods marked with this attribute will not be treated as rpc endpoints.

rpcArrayParams
RpcArrayParams rpcArrayParams [@property getter]

Methods marked with this attribute will see its parameters rendered as an array (if applicable by the protocol).

Structs

NoRpcMethodAttribute
struct NoRpcMethodAttribute
Undocumented in source.
RpcArrayParams
struct RpcArrayParams
Undocumented in source.
RpcIdTypeAttribute
struct RpcIdTypeAttribute(T)

Allow to specify the id type used by some rpc protocol (like json-rpc 2.0)

RpcMethodAttribute
struct RpcMethodAttribute
Undocumented in source.
RpcMethodObjectParams
struct RpcMethodObjectParams

On a rpc method, when RpcMethodObjectParams.asObject is selected, this attribute is used to customize the name rendered for each arg in the params object.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.