pub struct SessionData {
pub home_dc: i32,
pub dc_options: HashMap<i32, DcOption>,
pub peer_infos: HashMap<PeerId, PeerInfo>,
pub updates_state: UpdatesState,
}Expand description
In-memory representation of the entire Session state.
This type can be used for conversions From any Session,
and be SessionData::import_to any other Session.
Fields§
§home_dc: i32The identifier of the datacenter option determined to be the primary one for the logged-in user, or the identifier of an arbitrary datacenter otherwise.
dc_options: HashMap<i32, DcOption>List of all known datacenter options, along with their Authorization Key if an encrypted connection has been made to them previously. Indexed by their identifier.
peer_infos: HashMap<PeerId, PeerInfo>List of all peer informations cached in the session. Indexed by their identifier.
updates_state: UpdatesStateEntirety of the update state for the logged-in user.
Implementations§
Trait Implementations§
Source§impl Default for SessionData
impl Default for SessionData
Source§fn default() -> Self
fn default() -> Self
Constructs a default instance of the session data, with an arbitrary
Self::home_dc and the list of statically-known Self::dc_options.
Source§impl<S: Session> From<S> for SessionData
impl<S: Session> From<S> for SessionData
Source§impl From<SessionData> for MemorySession
impl From<SessionData> for MemorySession
Source§fn from(session_data: SessionData) -> Self
fn from(session_data: SessionData) -> Self
Constructs a memory session from the entirety of the session data,
unlike the blanket From implementation which cannot import all values