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.
This is an improved version of the tdlib-rs library, with the following additional features:
tdlib
to be compiled and installed on the system.pkg-config
to build the library and associated exported variables.download-tdlib
: download the precompiled library from the GitHub releases.local-tdlib
: use the tdlib
installed on the system.pkg-config
: use the pkg-config
to build the library.tdlib
library from the GitHub releases.We provide a precompiled version of the library for the supported platforms:
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.
Please see the documentation of the module build
for more information about the features here.
It functions that you can use to build the library in different ways.
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 = "...", features = [ "download-tdlib" ] }
[build-dependencies]
tdlib = { version = "...", features = [ "download-tdlib" ] }
// build.rs
fn main() {
tdlib_rs::build::build(None);
}
local-tdlib
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
Then you can enable the local-tdlib
feature in the Cargo.toml
file:
[dependencies]
tdlib = { version = "...", features = [ "local-tdlib" ] }
[build-dependencies]
tdlib = { version = "...", features = [ "local-tdlib" ] }
// build.rs
fn main() {
tdlib_rs::build::build(None);
}
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 = "...", features = [ "pkg-config" ] }
[build-dependencies]
tdlib = { version = "...", features = [ "pkg-config" ] }
// build.rs
fn main() {
tdlib_rs::build::build(None);
}
remember to have the tdlib
(version 1.8.29) compiled 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
This feature skip the linking of the library and only generate the code of generated.rs
.
Is used only for testing.
This feature enable the generation of the functions only used by Telegram bots.
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.
If you have any questions, suggestions, or feedback, do not hesitate to contact me.
Mantainers:
tdlib-tl-gen
and tdlib-tl-parser
projects are forks of the grammers-tl-gen
and grammers-tl-parser
projects.