Skip to main content

opentele2_core/
lib.rs

1//! Pure core of opentele2.
2//!
3//! This crate holds every Telegram Desktop `tdata` format and crypto rule
4//! shared by the Python and Node bindings. Its contract:
5//!
6//! - **Pure**: the core transforms bytes and values it is given; it walks no
7//!   filesystem beyond explicit paths passed by the caller.
8//! - **No async**: every function is synchronous; there is no runtime
9//!   dependency such as tokio.
10//! - **No network**: the core opens no sockets and speaks no `MTProto`
11//!   transport.
12//! - **No FFI**: bindings live in separate crates; this crate exports a plain
13//!   Rust API and forbids `unsafe` code.
14//!
15//! Every fallible operation returns [`Result`], whose error type [`Error`]
16//! carries a stable [`Error::code`] that bindings map onto their own
17//! exception types.
18//!
19//! The default feature `parallel` runs the [`batch`] entry points over
20//! independent folders on a dedicated rayon pool; without it they run
21//! sequentially with identical results.
22
23pub mod api;
24pub mod auth;
25pub mod batch;
26pub mod compress;
27pub mod crypto;
28pub mod devices;
29mod error;
30pub mod fingerprint;
31pub mod kdf;
32pub mod qt;
33pub mod session;
34pub mod tdata;
35pub mod tdf;
36
37pub use error::{ConfigFailure, Error, KeyDataFailure, MagicContext, MapReadFailure, Result};