Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

KeenS/tokio-thrift

 
 

Repository files navigation

A fork project of thehydroimpulse/thrust: Thrift RPC in Rust (Async I/O) http://thehydroimpulse.github.io/thrust to integrate with tokio-rs/tokio: Asynchronous I/O for Rust.

Status

UNDER DEVELOPMENT, NOT READY TO USE

Thrift IDL Support

Types

  • bool
  • byte
  • i8
  • i16
  • i32
  • i64
  • double
  • string
  • bynary
  • list
  • set
  • map

Constants

  • int
  • double
  • literal
  • list
  • map

Other Directives

  • comment
  • requiredness
    • required
    • optional
    • implicit (always infered to required)
  • namespace
  • include
  • const (see Constants for concrete supported literal)
  • typedef
  • struct
  • enum
    • VARIANT = n
  • union
  • exception
  • service
    • extends
    • function
      • oneway
      • void
      • throws
      • required
      • optional

and at service , exception handling is not so matured that the server may hung when it received corrupted data.

Code Generation

  • Command (tokio-thrift command)
  • [x] compiler plugin (thrift! , thrift_file! macro) abandaned because not so useful
  • build.rs (see example build.rs)

Thrift Implementation

  • protocol
    • binary protocol
  • transport
    • tokio integrated async TCP transport (framed transport)

Currently, framed transport supports only binary protocol.

Installing

using CLI

Note again that this project is NOT READY TO USE.

First, checkout this project and install the binary

git clone https://github.com/KeenS/tokio-thrift
cd tokio-thrift/tokio-thrift-bin
cargo install

then, run this command in your project to generate rust file

tokio-thrift your_file.thrift src/

using build.rs

see example build.rs

and in both cases, write below at your Cargo.toml

[dependencies]
tokio-thrift = {path = "path/to/tokio-thrift/tokio-thrift-lib"}

More

see examples.

License

MIT. See LICENSE.

About

Thrift RPC in Rust (Async I/O) with tokio

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 84.2%
  • HTML 15.0%
  • Thrift 0.8%