MTProto protocol and schema implementation in Rust.
Intended to provide low-level features to create a robust foundation for
higher-level libraries such as telegram-rs
.
Supports Rust 1.19 or newer. Older versions may work, but not guaranteed to.
Currently implemented and planned features include:
tl_codegen
)serde_mtproto
)There are 3 examples which you can build and run:
tcp_auth
Fetches authorization key over TCP. Supports 3 modes: abridged, intermediate and full (this example uses all three).
Based on tokio.
$ cargo run --example tcp_auth
# For verbose output use
$ RUST_LOG=tcp_auth=info cargo run --example tcp_auth
http_auth
Same as tcp_auth
but over HTTP which only has 1 mode.
$ cargo run --example http_auth
# For verbose output use
$ RUST_LOG=http_auth=info cargo run --example http_auth
dynamic
Dynamic typing using TLObject
in action.
$ cargo run --example dynamic
# For verbose output use
$ RUST_LOG=dynamic=info cargo run --example dynamic
You can also look at tests for more use cases which are automatically tested.
MTProto-rs is licensed under either of
at your option.