Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Rust wrapper around the Telegram Database Library 🦀

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

FedericoBruzzone/tdlib-rs

Repository files navigation

Latest versionDocumentationCI LinuxCI WindowsCI macOSdownloadslicense

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

Why this fork?

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

  1. It is cross-platform, it works on Windows, Linux and MacOS.
  2. Not requiredtdlib to be compiled and installed on the system.
  3. Not requiredpkg-config to build the library and associated exported variables.
  4. Three different ways to build the library:
    • download-tdlib: download the precompiled library from the GitHub releases.
    • local-tdlib: use thetdlib installed on the system.
    • pkg-config: use thepkg-config to build the library.
  5. It is possible to download thetdlib 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 thetgt client, but it should work also for any other Rust project.

Current supported TDLib version:1.8.29.

Cargo features

Please see the documentation of the modulebuild for more information about the featureshere.It functions that you can use to build the library in different ways.

download-tdlib

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

[dependencies]tdlib = {version ="...",features = ["download-tdlib" ] }[build-dependencies]tdlib = {version ="...",features = ["download-tdlib" ] }
// build.rsfnmain(){    tdlib_rs::build::build(None);}

local-tdlib

local-tdlib require you to have thetdlib (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 folderexport LOCAL_TDLIB_PATH=$HOME/lib/tdlib

Then you can enable thelocal-tdlib feature in theCargo.toml file:

[dependencies]tdlib = {version ="...",features = ["local-tdlib" ] }[build-dependencies]tdlib = {version ="...",features = ["local-tdlib" ] }
// build.rsfnmain(){    tdlib_rs::build::build(None);}

pkg-config

If you want to use thepkg-config to build this library, you should enable thepkg-config feature in theCargo.toml file:

[dependencies]tdlib = {version ="...",features = ["pkg-config" ] }[build-dependencies]tdlib = {version ="...",features = ["pkg-config" ] }
// build.rsfnmain(){    tdlib_rs::build::build(None);}

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

# pkg-config configurationexport PKG_CONFIG_PATH=$HOME/lib/tdlib/lib/pkgconfig/:$PKG_CONFIG_PATH# dynmic linker configurationexport LD_LIBRARY_PATH=$HOME/lib/tdlib/lib/:$LD_LIBRARY_PATH

docs

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

bots-only-api

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

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

If you have any questions, suggestions, or feedback, do not hesitate tocontact me.

Mantainers:

Credits

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

[8]ページ先頭

©2009-2025 Movatter.jp