Telegram MTProto API client in Rust, with RELIABILITY as the top priority.
Ideas for this project were massively inspired by ★ gramme.rs libraries.
This project is NOT a framework — it's a library, meaning there is NO
session management, input peer cache, or any high-level convenient API methods.
The user shall adapt the library for their own specific use-case, rather than
their projects, with HUNGRY-RS providing a stable base for Telegram clients.
See the crate, currently in this repository. This is a
replacement of bytes, designed for efficient, compile-time checked
operations on contiguous memory, with support for constant-sized buffers.
Work in progress.
- TL generation
- MTProto Transports
- Reader, Writer
- Sender
- Container
- Deserialization
- Gzip compression
- Salts
- Acknowledgment of Receipt
- RPC results
- Error recovery
- Client
- Stabilization
- Active testing
hungry-test— binary for testing the libraries
hungry— client, connection and protocol logichungry-tl— generated TL-schema, their traitshungry-tl-gen— TL-generator forhungry-tl
- Safe serialization buffer. (
&mut [MaybeUninit<u8>]=>&mut [u8]) - Generate an enum with all bare types (determined by
CONSTRUCTOR_ID) to catch deserialization failures early.- Box large variants.
- Optimize this monster.
- Wrapper for storing precalculated serialized length.
-
unbite::DynRawcontainer to easily unsplit buffers after they are received? - Write safety comments.
- Scrape documentation for types and functions?
- Support Gzip containers.
- Logging.
tracing/log? - Lower amount of unsafe code in
hungry-tl(current: ~5170). - Actual documentation.
- Remove TODOs.
todo!()&.unwrap()panics.// TODO:comments.
- Plain sender.
- Base. (
hungry::plain)
- Base. (
- Stabilize
unbitecrate.- Guarantee memory-safety.
- Reduce split/unsplit mess.
- Follow all security guidelines.
- Diffie-Hellman key exchange
- MTProto Encrypted Messages
- Checking SHA256 hash value of msg_key.
- Checking message length.
- Checking session_id.
- Checking msg_id.
- Seq no checking.
- Authorization / Sign in.
- Full error handling.
- Auth key generation.
- Bot sign in via token.
- Connection to different DC?
- Transport.
- Abridged.
- Intermediate.
- Quick ACK.
- Test.
- Padded intermediate.
- Full.
- Obfuscation.
- Test.
- Support quick ACKs higher than transport functions.
- Nice way to initialize transport.
-
OwnedWrite?
-
- Encrypted sender.
- Message container.
- Gzipping.
- "Zero-Copy" file uploading?
- Handle
msgs_ack.
- Salt management.
-
Sendable andCloneableClientto use theSender.
- Use
#[forbid(clippy::todo)]and#[forbid(unsafe_code)]as much as possible.
The repository will be recreated once this project is complete and refactored.
This project is licensed under the MIT license.