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 envelope;
17pub mod error;
18pub mod frame;
19pub mod proxy;
20pub mod socks5;
21pub mod transport;
22pub mod transport_kind;
23pub mod util;
24
25pub use connection::{Connection, ConnectionWriter, FutureSalt};
26pub use envelope::{EnvelopeResult, unwrap_envelope};
27pub use error::ConnectError;
28pub use frame::{FrameOutcome, recv_frame_with_keepalive};
29pub use proxy::MtProxyConfig;
30pub use socks5::Socks5Config;
31pub use transport_kind::TransportKind;
32pub use util::{crc32_ieee, gz_inflate, maybe_gz_decompress, random_i64, tl_read_bytes};
33
34// Additional exports needed by ferogram crate
35pub use connection::{NO_PING_DISCONNECT, PING_DELAY_SECS, SALT_USE_DELAY};
36pub use envelope::{chat_to_peer, decode_bind_response, decode_bind_single, updates_entities};
37pub use frame::{recv_frame_plain, recv_frame_read, send_frame, send_frame_write};
38pub use transport::{recv_abridged, recv_raw_frame, send_abridged};
39pub use util::{
40    COMPRESSION_THRESHOLD, build_container_body, build_msgs_ack_body, gz_pack_body, jitter_delay,
41    maybe_gz_pack, tl_read_string, tl_write_bytes,
42};