Crate grammers_session

Crate grammers_session 

Source
Expand description

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.

Modules§

defs
Session type definitions.
storages
Built-in crate::Session storages.
updates
Logic and types for Working with Updates.

Structs§

PeerAuthCacheDeprecated
In-memory chat cache, mapping peers to their respective access hashes.
SessionData
In-memory representation of the entire Session state.

Traits§

Session
The main interface to interact with the different crate::storages.