#telegram #tdlib #bindings #ffi #unsafe

sys tdjson-sys

TDLIB Json Client Rust FFI Bindings

6 releases

0.1.5 Feb 9, 2019
0.1.4 Feb 8, 2019
0.1.3 Nov 20, 2018
0.1.2 Feb 2, 2018

#9 in #unsafe

41 downloads per month
Used in 2 crates (1 directly)

MIT license

3KB

TDLIB Json Client Rust FFI Bindings

Installing TDLIB

In order to generate bindings, tdjson-sys needs the TDLIB to be intalled on a developer's system.

Clone the tdlib repo and checkout the wanted version.

git clone git@github.com:tdlib/td.git
cd td
git checkout v1.1.0

Install dependencies and build the library as described in the README.md

Then, install the library, from the build directory created in the previous step. (as root)

cmake --build . --target install

Generate Bindings

After installing tdlib, just add tdjson-sys to your crate's dependencies

tdjson-sys = "0.1.3"

And let the Cargo do it's magic!

cargo build

No runtime deps

~1.5MB
~32K SLoC

  • build build.rs
  • build bindgen 0.26.3