[][src]Crate thrift

Rust runtime library for the Apache Thrift RPC system.

This crate implements the components required to build a working Thrift server and client. It is divided into the following modules:

  1. errors
  2. protocol
  3. transport
  4. server
  5. autogen

The modules are layered as shown in the diagram below. The autogen'd layer is generated by the Thrift compiler's Rust plugin. It uses the types and functions defined in this crate to serialize and deserialize messages and implement RPC. Users interact with these types and services by writing their own code that uses the auto-generated clients and servers.

+-----------+
| user app  |
+-----------+
| autogen'd | (uses errors, autogen)
+-----------+
|  protocol |
+-----------+
| transport |
+-----------+

Modules

protocol

Types used to send and receive primitives between a Thrift client and server.

server

Types used to implement a Thrift server.

transport

Types used to send and receive bytes over an I/O channel.

Structs

ApplicationError

Information about errors in auto-generated code or in user-implemented service handlers.

OrderedFloat

A wrapper around Floats providing an implementation of Ord and Hash.

ProtocolError

Information about errors that occur in the runtime library.

TransportError

Information about I/O errors.

Enums

ApplicationErrorKind

Auto-generated or user-implemented code error categories.

Error

Error type returned by all runtime library functions.

ProtocolErrorKind

Runtime library error categories.

TransportErrorKind

I/O error categories.

Traits

TThriftClient

Specifies the minimum functionality an auto-generated client should provide to communicate with a Thrift server.

Functions

new_application_error

Create a new Error instance of type Application that wraps an ApplicationError.

new_protocol_error

Create a new Error instance of type Protocol that wraps a ProtocolError.

new_transport_error

Create a new Error instance of type Transport that wraps a TransportError.

Type Definitions

Result

Result type returned by all runtime library functions.