Skip to main content

ferogram_connect/
lib.rs

1// Copyright (c) Ankit Chaubey <ankitchaubey.dev@gmail.com>
2//
3// ferogram: async Telegram MTProto client in Rust
4// https://github.com/ankit-chaubey/ferogram
5//
6// Licensed under either the MIT License or the Apache License 2.0.
7// See the LICENSE-MIT or LICENSE-APACHE file in this repository:
8// https://github.com/ankit-chaubey/ferogram
9//
10// Feel free to use, modify, and share this code.
11// Please keep this notice when redistributing.
12
13#![deny(unsafe_code)]
14
15pub mod connection;
16pub mod error;
17pub mod frame;
18pub mod pfs;
19pub mod proxy;
20pub mod socks5;
21pub mod transport;
22pub mod transport_intermediate;
23pub mod transport_kind;
24pub mod transport_obfuscated;
25pub mod util;
26
27pub use connection::{Connection, FrameKind, FutureSalt, connect_to_dc};
28pub use error::ConnectError;
29pub use frame::send_frame;
30pub use pfs::{decode_bind_response, decode_bind_single};
31pub use proxy::MtProxyConfig;
32pub use socks5::Socks5Config;
33pub use transport_intermediate::{
34    FullTransport, IntermediateTransport, PaddedIntermediateTransport,
35};
36pub use transport_kind::TransportKind;
37pub use transport_obfuscated::{ObfuscatedFraming, ObfuscatedStream};
38pub use util::{crc32_ieee, gz_inflate, maybe_gz_decompress, random_i64, tl_read_bytes};
39
40// Additional exports needed by ferogram crate
41pub use connection::{NO_PING_DISCONNECT, PING_DELAY_SECS, SALT_USE_DELAY};
42pub use frame::recv_frame_plain;
43
44pub use util::{
45    COMPRESSION_THRESHOLD, build_container_body, build_msgs_ack_body, gz_pack_body, jitter_delay,
46    maybe_gz_pack, tl_read_string, tl_write_bytes,
47};