pub trait Channel {
    type TError;

    fn request<TRequest: Message, TReply: Message>(
        &mut self,
        plugin: String,
        name: String,
        request: TRequest
    ) -> Result<TReply, Self::TError>; }
Expand description

The Channel is the low-level exchange implementation.

It is in charge to serialize/deserialize messages, and exchange them with Dwarf Fortress. It is not meant to be used as is, but to be passed to It is analoguous to the gRPC channel.

Required Associated Types

Type of the errors raised by the stub.

Defined by the channel implementation.

Required Methods

Send a request to DFHack, and return its reply.

Errors

The error type is defined by the channel implementation

Arguments
  • plugin - Name of the plugin implementing the request. Example: “RemoteFortressReader”. Empty for core messages.
  • name - Name of the method. Example: “GetDFVersion”
  • request - Input of the method.
Returns

A protobuf result type.

Implementors