3 stable releases

new 1.0.3 Jun 14, 2024
1.0.2 May 26, 2024

#2 in #tdlib

Download history 471/week @ 2024-05-24 184/week @ 2024-05-31 160/week @ 2024-06-07

815 downloads per month

MIT/Apache

310KB
401 lines

tdlib-rs

CI Linux CI Windows CI macOS

A Rust wrapper around the Telegram Database library. It includes a generator to automatically generate the types and functions from the TDLib's Type Language file.

Why this fork?

This is an improved version of the tdlib-rs library, with the following additional features:

  1. It is cross-platform, it works on Windows, Linux and MacOS.
  2. Not required pkg-config to build the library and associated exported variables.
  3. Not required tdlib to be compiled and installed on the system.
  4. It is possible to download the tdlib library from the GitHub releases.

Information

We provide a precompiled version of the library for the supported platforms:

  • Linux (x86_64)
  • Windows (x86_64)
  • macOS Intel (x86_64)
  • macOS Apple Silicon (arm64)

We compile it in the CI and we upload the artifacts to the GitHub releases, so we can download it and use to build this library.

It's mainly created for using it in the tgt client, but it should work also for any other Rust project.

Current supported TDLib version: 1.8.29.

Cargo features

default

By default the library require you to have the tdlib (version 1.8.29) compiled and installed on your system, and the following variables exported, for example in the .bashrc file:

# The path to the tdlib folder
export LOCAL_TDLIB_PATH=$HOME/lib/tdlib

bots-only-api

This feature enable the generation of the functions only used by Telegram bots.

download-tdlib

If you don't want to compile and intall the tdlib on your system manually, you should enable the download-tdlib feature in the Cargo.toml file:

[dependencies]
tdlib = { version = "1.0.0", features = [ "download-tdlib" ] }

remember to check in the information section if your platform is supported.

pkg-config

If you want to use the pkg-config to build this library, you should enable the pkg-config feature in the Cargo.toml file:

[dependencies]
tdlib = { version = "1.0.0", features = [ "pkg-config" ] }

remember to have the tdlib (version 1.8.29) installed on your system, and the following variables exported, for example in the .bashrc file:

# pkg-config configuration
export PKG_CONFIG_PATH=$HOME/lib/tdlib/lib/pkgconfig/:$PKG_CONFIG_PATH

# dynmic linker configuration
export LD_LIBRARY_PATH=$HOME/lib/tdlib/lib/:$LD_LIBRARY_PATH

docs

This feature skip the linking of the library and only generate the code of generated.rs. Is used only for testing.

License

This repository are licensed under either of

at your option.

Please review the license file provided in the repository for more information regarding the terms and conditions of the license.

Contact

  • Email:
    • [federico.bruzzone.i@gmail.com]
    • [federico.bruzzone@studenti.unimi.it]
    • [andrea.longoni3@studenti.unimi.it]
  • GitHub:

Credits

  • grammers: the tdlib-tl-gen and tdlib-tl-parser projects are forks of the grammers-tl-gen and grammers-tl-parser projects.
  • rust-tdlib: for inspiration about some client code.
  • tdlib-rs: for inspiration about the generator code.

Dependencies

~1.4–3.5MB
~62K SLoC