Module garage_rpc::rpc_helper

source ·
Expand description

Contain structs related to making RPCs

Re-exports

pub use netapp;

Structs

This struct represents an endpoint for message of type M.
NetApp is the main class that handles incoming and outgoing connections.
An order tag can be added to a message or a response to indicate whether it should be sent after or before other messages with order tags referencing a same stream
The Req is a helper object used to create requests and attach them a stream of data. If the stream is a fixed Bytes and not a ByteStream, Req is cheaply clonable to allow the request to be sent to different peers (Clone will panic if the stream is a ByteStream).
Strategy to apply when making RPC
The Resp represents a full response from a RPC that may have an attached stream.

Constants

Priority class: background
Priority class: high
Priority class: normal
Priority: secondary among given class (ex: PRIO_HIGH | PRIO_SECONDARY)

Traits

This trait should be implemented by an object of your application that can handle a message of type M, in the cases where it doesn’t care about attached stream in the request nor in the response.
This trait should be implemented by all messages your application wants to handle. It specifies which data type should be sent as a response to this message in the RPC protocol.
This trait should be implemented by an object of your application that can handle a message of type M, if it wishes to handle streams attached to the request and/or to send back streams attached to the response..

Type Definitions

A node’s identifier, which is also its public cryptographic key
Priority of a request (click to read more about priorities).