Crate mini_telegram

source ·
Expand description

A minimal (i.e. very incomplete) implementation of a MTProto server and client.

The purpose of this project is to provide a larger example of an asynchronous Rust project built with Tokio. Do not attempt to run this in production… seriously.

Layout

The library is structured such that it can be used with guides. There are modules that are public that probably would not be public in a “real” MTProto client library.

The major components are:

  • server: MTProto server implementation. Includes a single run function that takes a TcpListener and starts accepting MTProto client connections.

  • client: an asynchronous MTProto client implementation.

  • cmd: implementations of the supported MTProto commands(APIs).

  • frame: represents a single MTProto protocol frame. A frame is used as an intermediate representation between a “command” and the byte representation.

Re-exports

pub use cmd::Command;
pub use frame::Frame;

Modules

Minimal blocking MTProto client implementation
Minimal MTProto client implementation
Provides a type representing a protocol frame as well as utilities for parsing frames from a byte array.
Minimal MTProto server implementation

Structs

Send and receive Frame values from a remote peer.

Constants

Default port that a MTProto server listens on.

Functions

Create a new client request buffer

Type Definitions

Error returned by most functions.
A specialized Result type for mini-telegram operations.