PitchHut logo
Seamlessly integrate Telegram with Rust's safety and performance.
Pitch

Introducing a powerful Rust wrapper for the Telegram Database Library, designed for ease of use and flexibility. With cross-platform support and simplified installation options, you can effortlessly harness Telegram's features without the hassle of traditional setup. Boost your projects with robust, safe, and efficient messaging integration.

Description

tdlib-rs is a powerful and efficient Rust wrapper around the Telegram Database Library (TDLib) 🦀, designed to simplify the integration of Telegram functionalities into your applications. This library automates the generation of types and functions directly from TDLib's Type Language (TL), providing developers with a seamless experience.

Key Features:

  • Cross-Platform Compatibility: Works flawlessly on Windows, Linux, and macOS, making it accessible to a wide range of users.
  • Simplified Setup: No need to compile and install TDLib manually on your system. With multiple build methods available, you can easily incorporate this library into your projects:
    • download-tdlib: Automatically download the precompiled library from GitHub releases.
    • local-tdlib: Utilize the TDLib already installed on your system.
    • pkg-config: Leverage pkg-config for libraries installed locally.
  • Precompiled Libraries: Get access to precompiled versions of the library for various platforms including Linux (x86_64), Windows (x86_64), and macOS (both Intel and Apple Silicon).

Current Supported Version:

This wrapper currently supports TDLib version 1.8.29, ensuring that you're working with the latest features and fixes.

Cargo Features:

Enhance your development process with the following features:

  • download-tdlib: Enable this feature for effortless setup without needing to install TDLib manually.
  • local-tdlib: Use your locally installed version of TDLib.
  • pkg-config: Utilize pkg-config for easier management of your development environment.
  • docs: Generate code for testing without linking the library.
  • bots-only-api: Access only the functions utilized by Telegram bots.

Integration Examples:

Here are a few snippets to help you get started:

Using download-tdlib

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

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

Using local-tdlib

# Set the local TDLib path
export LOCAL_TDLIB_PATH=$HOME/lib/tdlib
[dependencies]
tdlib = { version = "...", features = [ "local-tdlib" ] }

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

Using pkg-config

# pkg-config configuration
export PKG_CONFIG_PATH=$HOME/lib/tdlib/lib/pkgconfig/:$PKG_CONFIG_PATH
# dynamic linker configuration
export LD_LIBRARY_PATH=$HOME/lib/tdlib/lib/:$LD_LIBRARY_PATH
[dependencies]
tdlib = { version = "...", features = [ "pkg-config" ] }

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

Community Support:

For questions, suggestions, or feedback, feel free to reach out to the maintainers or participate in discussions via contact page.

Acknowledgements:

Special thanks to the community projects and contributors that inspired the development of this library including grammers and rust-tdlib. Join the growing ecosystem and enhance your Rust applications with the ease of tdlib-rs!

0 comments

No comments yet.

Sign in to be the first to comment.