1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2020 - developers of the `grammers` project.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! This library serves as the session interface for all of the crucial
//! data that other Telegram libraries would need to operate correctly, including:
//! - Datacenter addresses, to know where to connect.
//! - Permanent Authorization Keys bound to each datacenter.
//! - Update state, in order to catch up on missed updates while offline.
//! - Cached peers, necessary to interact with the API.
//!
//! Most of the data is bound to the specific session, and cannot be reused
//! outside of it. The exceptions are datacenter addresses, and update state
//! which is actually account-bound.
//!
//! To use with other libraries, you will want to instantiate one of the
//! [`storages`], which are what implement the [`Session`] trait.
//!
//! To convert between storages, you can use the [`SessionData`] as an
//! intermediate step, and use its `From` implementations in combination
//! with [`SessionData::import_to`]. Note that the `From` implementation
//! will not copy all of the data, only that which is necessary.
pub use ;
pub use Session;
pub use SessionData;